<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Directory.Internal.Windows</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LINE 5 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span class="hs-cpp">
#if defined(i386_HOST_ARCH)
</span><span class="hs-cpp"># define WINAPI stdcall
</span><span class="hs-cpp">#elif defined(x86_64_HOST_ARCH)
</span><span class="hs-cpp"># define WINAPI ccall
</span><span class="hs-cpp">#else
</span><span class="hs-cpp"># error unknown architecture
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Directory.Internal.Prelude.html"><span class="hs-identifier">System.Directory.Internal.Prelude</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html"><span class="hs-identifier">System.Directory.Internal.Common</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Directory.Internal.Config.html"><span class="hs-identifier">System.Directory.Internal.Config</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Directory.Internal.Config.html#exeExtension"><span class="hs-identifier">exeExtension</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.html#"><span class="hs-identifier">Data.Time</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier">UTCTime</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.POSIX.html#"><span class="hs-identifier">Data.Time.Clock.POSIX</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier">POSIXTime</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.POSIX.html#posixSecondsToUTCTime"><span class="hs-identifier">posixSecondsToUTCTime</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-23"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#isPathSeparator"><span class="hs-identifier">isPathSeparator</span></a></span><span>
</span><span id="line-25"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#isRelative"><span class="hs-identifier">isRelative</span></a></span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#pathSeparator"><span class="hs-identifier">pathSeparator</span></a></span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier">splitDirectories</span></a></span><span>
</span><span id="line-28"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeExtension"><span class="hs-identifier">takeExtension</span></a></span><span>
</span><span id="line-29"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">List</span></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.html#"><span class="hs-identifier">System.Win32</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Win32</span></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#createDirectoryInternal"><span class="hs-identifier hs-type">createDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span id="createDirectoryInternal"><span class="annot"><span class="annottext">createDirectoryInternal :: String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#createDirectoryInternal"><span class="hs-identifier hs-var hs-var">createDirectoryInternal</span></a></span></span><span> </span><span id="local-6989586621679048301"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048301"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-35"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048301"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-36"></span><span>    </span><span id="local-6989586621679048298"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048298"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048301"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; Maybe LPSECURITY_ATTRIBUTES -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#createDirectory"><span class="hs-identifier hs-var">Win32.createDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048298"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LPSECURITY_ATTRIBUTES
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#removePathInternal"><span class="hs-identifier hs-type">removePathInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span id="removePathInternal"><span class="annot"><span class="annottext">removePathInternal :: Bool -&gt; String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#removePathInternal"><span class="hs-identifier hs-var hs-var">removePathInternal</span></a></span></span><span> </span><span id="local-6989586621679048294"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048294"><span class="hs-identifier hs-var">isDir</span></a></span></span><span> </span><span id="local-6989586621679048293"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-41"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-43"></span><span>      </span><span class="annot"><span class="annottext">IO String -&gt; (String -&gt; IO ()) -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048294"><span class="hs-identifier hs-var">isDir</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#removeDirectory"><span class="hs-identifier hs-var">Win32.removeDirectory</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#deleteFile"><span class="hs-identifier hs-var">Win32.deleteFile</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#renamePathInternal"><span class="hs-identifier hs-type">renamePathInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span id="renamePathInternal"><span class="annot"><span class="annottext">renamePathInternal :: String -&gt; String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#renamePathInternal"><span class="hs-identifier hs-var hs-var">renamePathInternal</span></a></span></span><span> </span><span id="local-6989586621679048289"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">opath</span></a></span></span><span> </span><span id="local-6989586621679048288"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048288"><span class="hs-identifier hs-var">npath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-47"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">opath</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-48"></span><span>    </span><span id="local-6989586621679048287"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048287"><span class="hs-identifier hs-var">opath'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">opath</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span id="local-6989586621679048286"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048286"><span class="hs-identifier hs-var">npath'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048288"><span class="hs-identifier hs-var">npath</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-pragma">{-# LINE 51 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-identifier">Win32.moveFileEx</span><span> </span><span class="hs-identifier">opath'</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Just</span><span> </span><span class="hs-identifier">npath'</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">Win32.mOVEFILE_REPLACE_EXISTING</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-pragma">{-# LINE 55 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#copyFileWithMetadataInternal"><span class="hs-identifier hs-type">copyFileWithMetadataInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-59"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-60"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span id="copyFileWithMetadataInternal"><span class="annot"><span class="annottext">copyFileWithMetadataInternal :: (Metadata -&gt; String -&gt; IO ())
-&gt; (Metadata -&gt; String -&gt; IO ()) -&gt; String -&gt; String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#copyFileWithMetadataInternal"><span class="hs-identifier hs-var hs-var">copyFileWithMetadataInternal</span></a></span></span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; String -&gt; IO ()
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; String -&gt; IO ()
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048282"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048282"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679048281"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048281"><span class="hs-identifier hs-var">dst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048282"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-63"></span><span>    </span><span id="local-6989586621679048280"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048280"><span class="hs-identifier hs-var">src'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048282"><span class="hs-identifier hs-var">src</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span id="local-6989586621679048279"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048279"><span class="hs-identifier hs-var">dst'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048281"><span class="hs-identifier hs-var">dst</span></a></span><span>
</span><span id="line-65"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#copyFile"><span class="hs-identifier hs-var">Win32.copyFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048280"><span class="hs-identifier hs-var">src'</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048279"><span class="hs-identifier hs-var">dst'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_cSIDL_LOCAL_APPDATA"><span class="hs-identifier hs-type">win32_cSIDL_LOCAL_APPDATA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Shell.html#CSIDL"><span class="hs-identifier hs-type">Win32.CSIDL</span></a></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span id="win32_cSIDL_LOCAL_APPDATA"><span class="hs-pragma">{-# LINE 69 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span></span><span>
</span><span id="line-69"></span><span class="hs-identifier">win32_cSIDL_LOCAL_APPDATA</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Win32.cSIDL_LOCAL_APPDATA</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-pragma">{-# LINE 73 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_cSIDL_COMMON_APPDATA"><span class="hs-identifier hs-type">win32_cSIDL_COMMON_APPDATA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Shell.html#CSIDL"><span class="hs-identifier hs-type">Win32.CSIDL</span></a></span><span>
</span><span id="line-75"></span><span id="win32_cSIDL_COMMON_APPDATA"><span class="annot"><span class="annottext">win32_cSIDL_COMMON_APPDATA :: CSIDL
</span><a href="System.Directory.Internal.Windows.html#win32_cSIDL_COMMON_APPDATA"><span class="hs-identifier hs-var hs-var">win32_cSIDL_COMMON_APPDATA</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CSIDL
</span><span class="hs-number">35</span></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-pragma">{-# LINE 76 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_FUNCTION"><span class="hs-identifier hs-type">win32_eRROR_INVALID_FUNCTION</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#ErrCode"><span class="hs-identifier hs-type">Win32.ErrCode</span></a></span><span>
</span><span id="line-78"></span><span id="win32_eRROR_INVALID_FUNCTION"><span class="annot"><span class="annottext">win32_eRROR_INVALID_FUNCTION :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_FUNCTION"><span class="hs-identifier hs-var hs-var">win32_eRROR_INVALID_FUNCTION</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-pragma">{-# LINE 79 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_PARAMETER"><span class="hs-identifier hs-type">win32_eRROR_INVALID_PARAMETER</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#ErrCode"><span class="hs-identifier hs-type">Win32.ErrCode</span></a></span><span>
</span><span id="line-81"></span><span id="win32_eRROR_INVALID_PARAMETER"><span class="annot"><span class="annottext">win32_eRROR_INVALID_PARAMETER :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_PARAMETER"><span class="hs-identifier hs-var hs-var">win32_eRROR_INVALID_PARAMETER</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">87</span></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span class="hs-pragma">{-# LINE 82 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_eRROR_PRIVILEGE_NOT_HELD"><span class="hs-identifier hs-type">win32_eRROR_PRIVILEGE_NOT_HELD</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#ErrCode"><span class="hs-identifier hs-type">Win32.ErrCode</span></a></span><span>
</span><span id="line-84"></span><span id="win32_eRROR_PRIVILEGE_NOT_HELD"><span class="annot"><span class="annottext">win32_eRROR_PRIVILEGE_NOT_HELD :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_PRIVILEGE_NOT_HELD"><span class="hs-identifier hs-var hs-var">win32_eRROR_PRIVILEGE_NOT_HELD</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">1314</span></span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span class="hs-pragma">{-# LINE 85 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_sYMBOLIC_LINK_FLAG_DIRECTORY"><span class="hs-identifier hs-type">win32_sYMBOLIC_LINK_FLAG_DIRECTORY</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-87"></span><span id="win32_sYMBOLIC_LINK_FLAG_DIRECTORY"><span class="annot"><span class="annottext">win32_sYMBOLIC_LINK_FLAG_DIRECTORY :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_sYMBOLIC_LINK_FLAG_DIRECTORY"><span class="hs-identifier hs-var hs-var">win32_sYMBOLIC_LINK_FLAG_DIRECTORY</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0x1</span></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE"><span class="hs-identifier hs-type">win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-90"></span><span id="win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE"><span class="annot"><span class="annottext">win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE"><span class="hs-identifier hs-var hs-var">win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0x2</span></span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_fILE_ATTRIBUTE_REPARSE_POINT"><span class="hs-identifier hs-type">win32_fILE_ATTRIBUTE_REPARSE_POINT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#FileAttributeOrFlag"><span class="hs-identifier hs-type">Win32.FileAttributeOrFlag</span></a></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span id="win32_fILE_ATTRIBUTE_REPARSE_POINT"><span class="hs-pragma">{-# LINE 94 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span></span><span>
</span><span id="line-94"></span><span class="hs-identifier">win32_fILE_ATTRIBUTE_REPARSE_POINT</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Win32.fILE_ATTRIBUTE_REPARSE_POINT</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-pragma">{-# LINE 98 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_fILE_SHARE_DELETE"><span class="hs-identifier hs-type">win32_fILE_SHARE_DELETE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#ShareMode"><span class="hs-identifier hs-type">Win32.ShareMode</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span id="win32_fILE_SHARE_DELETE"><span class="hs-pragma">{-# LINE 101 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span></span><span>
</span><span id="line-101"></span><span class="hs-identifier">win32_fILE_SHARE_DELETE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Win32.fILE_SHARE_DELETE</span><span> </span><span class="hs-comment">-- added in 2.3.0.2</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-pragma">{-# LINE 105 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-type">maxShareMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#ShareMode"><span class="hs-identifier hs-type">Win32.ShareMode</span></a></span><span>
</span><span id="line-107"></span><span id="maxShareMode"><span class="annot"><span class="annottext">maxShareMode :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-var hs-var">maxShareMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-108"></span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fILE_SHARE_DELETE"><span class="hs-identifier hs-var">win32_fILE_SHARE_DELETE</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span>
</span><span id="line-109"></span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_SHARE_READ"><span class="hs-identifier hs-var">Win32.fILE_SHARE_READ</span></a></span><span>   </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span>
</span><span id="line-110"></span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_SHARE_WRITE"><span class="hs-identifier hs-var">Win32.fILE_SHARE_WRITE</span></a></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_getLongPathName"><span class="hs-identifier hs-type">win32_getLongPathName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_getShortPathName"><span class="hs-identifier hs-type">win32_getShortPathName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span id="win32_getLongPathName"><span class="hs-pragma">{-# LINE 114 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span></span><span>
</span><span id="line-114"></span><span class="hs-identifier">win32_getLongPathName</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Win32.getLongPathName</span><span>
</span><span id="line-115"></span><span id="win32_getShortPathName"><span class="annot"><span class="annottext">win32_getShortPathName :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#win32_getShortPathName"><span class="hs-identifier hs-var hs-var">win32_getShortPathName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="../../Win32/src/System.Win32.Info.html#getShortPathName"><span class="hs-identifier hs-var">Win32.getShortPathName</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-pragma">{-# LINE 143 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_getFinalPathNameByHandle"><span class="hs-identifier hs-type">win32_getFinalPathNameByHandle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-145"></span><span id="win32_getFinalPathNameByHandle"><span class="annot"><span class="annottext">win32_getFinalPathNameByHandle :: HANDLE -&gt; SHGetFolderPathFlags -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#win32_getFinalPathNameByHandle"><span class="hs-identifier hs-var hs-var">win32_getFinalPathNameByHandle</span></a></span></span><span> </span><span id="local-6989586621679048252"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048252"><span class="hs-identifier hs-var">_h</span></a></span></span><span> </span><span id="local-6989586621679048251"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048251"><span class="hs-identifier hs-var">_flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetLocation"><span class="hs-operator hs-var">`ioeSetLocation`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GetFinalPathNameByHandle&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO String -&gt; IO String
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-pragma">{-# LINE 148 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-identifier">getPathNameWith</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">ptr</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-149"></span><span>      </span><span class="hs-identifier">c_GetFinalPathNameByHandle</span><span> </span><span class="hs-identifier">_h</span><span> </span><span class="hs-identifier">ptr</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-identifier">_flags</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINAPI</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetFinalPathNameByHandleW&quot;</span><span>
</span><span id="line-152"></span><span>  </span><span id="c_GetFinalPathNameByHandle"><span class="annot"><a href="System.Directory.Internal.Windows.html#c_GetFinalPathNameByHandle"><span class="hs-identifier hs-var">c_GetFinalPathNameByHandle</span></a></span></span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span>
</span><span id="line-154"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span>
</span><span id="line-155"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-156"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-157"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-pragma">{-# LINE 164 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getFinalPathName"><span class="hs-identifier hs-type">getFinalPathName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-166"></span><span id="getFinalPathName"><span class="annot"><span class="annottext">getFinalPathName :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFinalPathName"><span class="hs-identifier hs-var hs-var">getFinalPathName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#fromExtendedLengthPath"><span class="hs-identifier hs-var">fromExtendedLengthPath</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; IO String -&gt; IO String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO String -&gt; IO String)
-&gt; (String -&gt; IO String) -&gt; String -&gt; IO String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="#local-6989586621679048241"><span class="hs-identifier hs-var">rawGetFinalPathName</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; (String -&gt; String) -&gt; String -&gt; IO String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-var">toExtendedLengthPath</span></a></span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-pragma">{-# LINE 170 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-identifier">rawGetFinalPathName</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-171"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">open</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Win32.createFile</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-identifier">maxShareMode</span><span> </span><span class="hs-identifier">Nothing</span><span>
</span><span id="line-172"></span><span>                 </span><span class="hs-identifier">Win32.oPEN_EXISTING</span><span> </span><span class="hs-identifier">Win32.fILE_FLAG_BACKUP_SEMANTICS</span><span> </span><span class="hs-identifier">Nothing</span><span>
</span><span id="line-173"></span><span>      </span><span class="hs-identifier">bracket</span><span> </span><span class="hs-identifier">open</span><span> </span><span class="hs-identifier">Win32.closeHandle</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-identifier">win32_getFinalPathNameByHandle</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-pragma">{-# LINE 178 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_fILE_FLAG_OPEN_REPARSE_POINT"><span class="hs-identifier hs-type">win32_fILE_FLAG_OPEN_REPARSE_POINT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#FileAttributeOrFlag"><span class="hs-identifier hs-type">Win32.FileAttributeOrFlag</span></a></span><span>
</span><span id="line-180"></span><span id="win32_fILE_FLAG_OPEN_REPARSE_POINT"><span class="annot"><span class="annottext">win32_fILE_FLAG_OPEN_REPARSE_POINT :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fILE_FLAG_OPEN_REPARSE_POINT"><span class="hs-identifier hs-var hs-var">win32_fILE_FLAG_OPEN_REPARSE_POINT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0x00200000</span></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_fSCTL_GET_REPARSE_POINT"><span class="hs-identifier hs-type">win32_fSCTL_GET_REPARSE_POINT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-183"></span><span id="win32_fSCTL_GET_REPARSE_POINT"><span class="annot"><span class="annottext">win32_fSCTL_GET_REPARSE_POINT :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fSCTL_GET_REPARSE_POINT"><span class="hs-identifier hs-var hs-var">win32_fSCTL_GET_REPARSE_POINT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0x900a8</span></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_iO_REPARSE_TAG_MOUNT_POINT"><span class="hs-identifier hs-type">win32_iO_REPARSE_TAG_MOUNT_POINT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_iO_REPARSE_TAG_SYMLINK"><span class="hs-identifier hs-type">win32_iO_REPARSE_TAG_SYMLINK</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CULong"><span class="hs-identifier hs-type">CULong</span></a></span><span>
</span><span id="line-186"></span><span id="win32_iO_REPARSE_TAG_MOUNT_POINT"><span class="annot"><span class="annottext">win32_iO_REPARSE_TAG_MOUNT_POINT :: CULong
</span><a href="System.Directory.Internal.Windows.html#win32_iO_REPARSE_TAG_MOUNT_POINT"><span class="hs-identifier hs-var hs-var">win32_iO_REPARSE_TAG_MOUNT_POINT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CULong
</span><span class="hs-number">2684354563</span></span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span id="win32_iO_REPARSE_TAG_SYMLINK"><span class="hs-pragma">{-# LINE 187 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span></span><span>
</span><span id="line-187"></span><span class="hs-identifier">win32_iO_REPARSE_TAG_SYMLINK</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-number">2684354572</span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span class="hs-pragma">{-# LINE 188 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE"><span class="hs-identifier hs-type">win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-190"></span><span id="win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE"><span class="annot"><span class="annottext">win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE :: SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE"><span class="hs-identifier hs-var hs-var">win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-191"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">16384</span></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span class="hs-pragma">{-# LINE 192 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_sYMLINK_FLAG_RELATIVE"><span class="hs-identifier hs-type">win32_sYMLINK_FLAG_RELATIVE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CULong"><span class="hs-identifier hs-type">CULong</span></a></span><span>
</span><span id="line-194"></span><span id="win32_sYMLINK_FLAG_RELATIVE"><span class="annot"><span class="annottext">win32_sYMLINK_FLAG_RELATIVE :: CULong
</span><a href="System.Directory.Internal.Windows.html#win32_sYMLINK_FLAG_RELATIVE"><span class="hs-identifier hs-var hs-var">win32_sYMLINK_FLAG_RELATIVE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CULong
</span><span class="hs-number">0x00000001</span></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-keyword">data</span><span> </span><span id="Win32_REPARSE_DATA_BUFFER"><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">Win32_REPARSE_DATA_BUFFER</span></a></span></span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Win32_MOUNT_POINT_REPARSE_DATA_BUFFER"><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_MOUNT_POINT_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">Win32_MOUNT_POINT_REPARSE_DATA_BUFFER</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-comment">-- ^ substituteName printName</span><span>
</span><span id="line-199"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Win32_SYMLINK_REPARSE_DATA_BUFFER"><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_SYMLINK_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">Win32_SYMLINK_REPARSE_DATA_BUFFER</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-comment">-- ^ substituteName printName isRelative</span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Win32_GENERIC_REPARSE_DATA_BUFFER"><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_GENERIC_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">Win32_GENERIC_REPARSE_DATA_BUFFER</span></a></span></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span id="local-6989586621679048535"><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_alloca_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">win32_alloca_REPARSE_DATA_BUFFER</span></a></span><span>
</span><span id="line-204"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">Win32_REPARSE_DATA_BUFFER</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679048535"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679048535"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-205"></span><span id="win32_alloca_REPARSE_DATA_BUFFER"><span class="annot"><span class="annottext">win32_alloca_REPARSE_DATA_BUFFER :: forall a. ((Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO a) -&gt; IO a
</span><a href="System.Directory.Internal.Windows.html#win32_alloca_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var hs-var">win32_alloca_REPARSE_DATA_BUFFER</span></a></span></span><span> </span><span id="local-6989586621679048219"><span class="annot"><span class="annottext">(Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO a
</span><a href="#local-6989586621679048219"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-206"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; (Ptr Win32_REPARSE_DATA_BUFFER -&gt; IO a) -&gt; IO a
forall a b. Int -&gt; Int -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Alloc.html#allocaBytesAligned"><span class="hs-identifier hs-var">allocaBytesAligned</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048217"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048216"><span class="hs-identifier hs-var">align</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr Win32_REPARSE_DATA_BUFFER -&gt; IO a) -&gt; IO a)
-&gt; (Ptr Win32_REPARSE_DATA_BUFFER -&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679048215"><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048215"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-207"></span><span>    </span><span class="annot"><span class="annottext">(Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO a
</span><a href="#local-6989586621679048219"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048215"><span class="hs-identifier hs-var">ptr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048217"><span class="hs-identifier hs-var">size</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679048217"><span class="annot"><span class="annottext">size :: Int
</span><a href="#local-6989586621679048217"><span class="hs-identifier hs-var hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE"><span class="hs-identifier hs-var">win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE</span></a></span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-comment">-- workaround (hsc2hs for GHC &lt; 8.0 don't support #{alignment ...})</span><span>
</span><span id="line-210"></span><span>        </span><span id="local-6989586621679048216"><span class="annot"><span class="annottext">align :: Int
</span><a href="#local-6989586621679048216"><span class="hs-identifier hs-var hs-var">align</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span class="hs-pragma">{-# LINE 211 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#win32_peek_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">win32_peek_REPARSE_DATA_BUFFER</span></a></span><span>
</span><span id="line-213"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">Win32_REPARSE_DATA_BUFFER</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">Win32_REPARSE_DATA_BUFFER</span></a></span><span>
</span><span id="line-214"></span><span id="win32_peek_REPARSE_DATA_BUFFER"><span class="annot"><span class="annottext">win32_peek_REPARSE_DATA_BUFFER :: Ptr Win32_REPARSE_DATA_BUFFER -&gt; IO Win32_REPARSE_DATA_BUFFER
</span><a href="System.Directory.Internal.Windows.html#win32_peek_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var hs-var">win32_peek_REPARSE_DATA_BUFFER</span></a></span></span><span> </span><span id="local-6989586621679048209"><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048209"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-215"></span><span>  </span><span id="local-6989586621679048208"><span class="annot"><span class="annottext">CULong
</span><a href="#local-6989586621679048208"><span class="hs-identifier hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679048207"><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048207"><span class="hs-identifier hs-var">hsc_ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER -&gt; Int -&gt; IO CULong
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peekByteOff"><span class="hs-identifier hs-var">peekByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048207"><span class="hs-identifier hs-var">hsc_ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048209"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-216"></span><span class="hs-pragma">{-# LINE 216 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-217"></span><span>    </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">tag</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">win32_iO_REPARSE_TAG_MOUNT_POINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-218"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-219"></span><span class="hs-pragma">{-# LINE 220 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-220"></span><span>          </span><span class="hs-identifier">sni</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-221"></span><span class="hs-pragma">{-# LINE 222 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-222"></span><span>          </span><span class="hs-identifier">sns</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">10</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-223"></span><span class="hs-pragma">{-# LINE 224 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-224"></span><span>          </span><span class="hs-identifier">sn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekName</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">sni</span><span> </span><span class="hs-identifier">sns</span><span>
</span><span id="line-225"></span><span>          </span><span class="hs-identifier">pni</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">12</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-226"></span><span class="hs-pragma">{-# LINE 227 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-227"></span><span>          </span><span class="hs-identifier">pns</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">14</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-228"></span><span class="hs-pragma">{-# LINE 229 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-229"></span><span>          </span><span class="hs-identifier">pn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekName</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">pni</span><span> </span><span class="hs-identifier">pns</span><span>
</span><span id="line-230"></span><span>          </span><span class="hs-identifier">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Win32_MOUNT_POINT_REPARSE_DATA_BUFFER</span><span> </span><span class="hs-identifier">sn</span><span> </span><span class="hs-identifier">pn</span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">tag</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">win32_iO_REPARSE_TAG_SYMLINK</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-232"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">plusPtr</span><span class="hs-special">`</span><span> </span><span class="hs-number">20</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-233"></span><span class="hs-pragma">{-# LINE 234 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-234"></span><span>          </span><span class="hs-identifier">sni</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-235"></span><span class="hs-pragma">{-# LINE 236 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-236"></span><span>          </span><span class="hs-identifier">sns</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">10</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-237"></span><span class="hs-pragma">{-# LINE 238 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-238"></span><span>          </span><span class="hs-identifier">sn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekName</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">sni</span><span> </span><span class="hs-identifier">sns</span><span>
</span><span id="line-239"></span><span>          </span><span class="hs-identifier">pni</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">12</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-240"></span><span class="hs-pragma">{-# LINE 241 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-241"></span><span>          </span><span class="hs-identifier">pns</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">14</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-242"></span><span class="hs-pragma">{-# LINE 243 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-243"></span><span>          </span><span class="hs-identifier">pn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekName</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">pni</span><span> </span><span class="hs-identifier">pns</span><span>
</span><span id="line-244"></span><span>          </span><span class="hs-identifier">flags</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">p</span><span>
</span><span id="line-245"></span><span class="hs-pragma">{-# LINE 246 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-246"></span><span>          </span><span class="hs-identifier">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Win32_SYMLINK_REPARSE_DATA_BUFFER</span><span> </span><span class="hs-identifier">sn</span><span> </span><span class="hs-identifier">pn</span><span>
</span><span id="line-247"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">flags</span><span> </span><span class="hs-operator">.&amp;.</span><span> </span><span class="hs-identifier">win32_sYMLINK_FLAG_RELATIVE</span><span> </span><span class="hs-operator">/=</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pure</span><span> </span><span class="hs-identifier">Win32_GENERIC_REPARSE_DATA_BUFFER</span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-250"></span><span>    </span><span class="annot"><a href="#local-6989586621679048197"><span class="hs-identifier hs-type">peekName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CUShort"><span class="hs-identifier hs-type">CUShort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CUShort"><span class="hs-identifier hs-type">CUShort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-251"></span><span>    </span><span id="local-6989586621679048197"><span class="annot"><span class="annottext">peekName :: Ptr CWchar -&gt; CUShort -&gt; CUShort -&gt; IO String
</span><a href="#local-6989586621679048197"><span class="hs-identifier hs-var hs-var">peekName</span></a></span></span><span> </span><span id="local-6989586621679048175"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">buf</span></a></span></span><span> </span><span id="local-6989586621679048174"><span class="annot"><span class="annottext">CUShort
</span><a href="#local-6989586621679048174"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span id="local-6989586621679048173"><span class="annot"><span class="annottext">CUShort
</span><a href="#local-6989586621679048173"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-252"></span><span>      </span><span class="annot"><span class="annottext">CWStringLen -&gt; IO String
</span><a href="../../base/src/Foreign.C.String.html#peekCWStringLen"><span class="hs-identifier hs-var">peekCWStringLen</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar -&gt; Int -&gt; Ptr CWchar
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">CUShort -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">CUShort
</span><a href="#local-6989586621679048174"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-253"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CUShort -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">CUShort
</span><a href="#local-6989586621679048173"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">CWchar -&gt; Int
forall a. Storable a =&gt; a -&gt; Int
</span><a href="../../base/src/Foreign.Storable.html#sizeOf"><span class="hs-identifier hs-var">sizeOf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CWchar
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span id="local-6989586621679048517"><span id="local-6989586621679048518"><span class="annot"><a href="System.Directory.Internal.Windows.html#deviceIoControl"><span class="hs-identifier hs-type">deviceIoControl</span></a></span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span>
</span><span id="line-257"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048518"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048517"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Void.html#Void"><span class="hs-identifier hs-type">Void</span></a></span><span>
</span><span id="line-261"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#ErrCode"><span class="hs-identifier hs-type">Win32.ErrCode</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-262"></span><span id="deviceIoControl"><span class="annot"><span class="annottext">deviceIoControl :: forall a b.
HANDLE
-&gt; SHGetFolderPathFlags
-&gt; (Ptr a, Int)
-&gt; (Ptr b, Int)
-&gt; Maybe Void
-&gt; IO (Either SHGetFolderPathFlags Int)
</span><a href="System.Directory.Internal.Windows.html#deviceIoControl"><span class="hs-identifier hs-var hs-var">deviceIoControl</span></a></span></span><span> </span><span id="local-6989586621679048155"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048155"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621679048154"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048154"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048153"><span class="annot"><span class="annottext">Ptr a
</span><a href="#local-6989586621679048153"><span class="hs-identifier hs-var">inPtr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048152"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048152"><span class="hs-identifier hs-var">inSize</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048151"><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621679048151"><span class="hs-identifier hs-var">outPtr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048150"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048150"><span class="hs-identifier hs-var">outSize</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Void
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-263"></span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; (Ptr SHGetFolderPathFlags
    -&gt; IO (Either SHGetFolderPathFlags Int))
-&gt; IO (Either SHGetFolderPathFlags Int)
forall a b. Storable a =&gt; a -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Utils.html#with"><span class="hs-identifier hs-var">with</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">((Ptr SHGetFolderPathFlags -&gt; IO (Either SHGetFolderPathFlags Int))
 -&gt; IO (Either SHGetFolderPathFlags Int))
-&gt; (Ptr SHGetFolderPathFlags
    -&gt; IO (Either SHGetFolderPathFlags Int))
-&gt; IO (Either SHGetFolderPathFlags Int)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679048148"><span class="annot"><span class="annottext">Ptr SHGetFolderPathFlags
</span><a href="#local-6989586621679048148"><span class="hs-identifier hs-var">lenPtr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-264"></span><span>    </span><span id="local-6989586621679048147"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048147"><span class="hs-identifier hs-var">ok</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HANDLE
-&gt; SHGetFolderPathFlags
-&gt; Ptr a
-&gt; SHGetFolderPathFlags
-&gt; Ptr b
-&gt; SHGetFolderPathFlags
-&gt; Ptr SHGetFolderPathFlags
-&gt; Ptr Void
-&gt; IO Bool
forall a b.
HANDLE
-&gt; SHGetFolderPathFlags
-&gt; Ptr a
-&gt; SHGetFolderPathFlags
-&gt; Ptr b
-&gt; SHGetFolderPathFlags
-&gt; Ptr SHGetFolderPathFlags
-&gt; Ptr Void
-&gt; IO Bool
</span><a href="System.Directory.Internal.Windows.html#c_DeviceIoControl"><span class="hs-identifier hs-var">c_DeviceIoControl</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048155"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048154"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr a
</span><a href="#local-6989586621679048153"><span class="hs-identifier hs-var">inPtr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; SHGetFolderPathFlags
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048152"><span class="hs-identifier hs-var">inSize</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621679048151"><span class="hs-identifier hs-var">outPtr</span></a></span><span>
</span><span id="line-265"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; SHGetFolderPathFlags
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048150"><span class="hs-identifier hs-var">outSize</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr SHGetFolderPathFlags
</span><a href="#local-6989586621679048148"><span class="hs-identifier hs-var">lenPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Void
forall {b}. Ptr b
</span><a href="../../base/src/GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span>
</span><span id="line-266"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048147"><span class="hs-identifier hs-var">ok</span></a></span><span>
</span><span id="line-267"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Either SHGetFolderPathFlags Int
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Either SHGetFolderPathFlags Int)
-&gt; (SHGetFolderPathFlags -&gt; Int)
-&gt; SHGetFolderPathFlags
-&gt; Either SHGetFolderPathFlags Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(SHGetFolderPathFlags -&gt; Either SHGetFolderPathFlags Int)
-&gt; IO SHGetFolderPathFlags -&gt; IO (Either SHGetFolderPathFlags Int)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr SHGetFolderPathFlags -&gt; IO SHGetFolderPathFlags
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr SHGetFolderPathFlags
</span><a href="#local-6989586621679048148"><span class="hs-identifier hs-var">lenPtr</span></a></span><span>
</span><span id="line-268"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Either SHGetFolderPathFlags Int
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(SHGetFolderPathFlags -&gt; Either SHGetFolderPathFlags Int)
-&gt; IO SHGetFolderPathFlags -&gt; IO (Either SHGetFolderPathFlags Int)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IO SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.Types.html#getLastError"><span class="hs-identifier hs-var">Win32.getLastError</span></a></span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span id="local-6989586621679048510"><span id="local-6989586621679048511"><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINAPI</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h DeviceIoControl&quot;</span><span>
</span><span id="line-271"></span><span>  </span><span id="c_DeviceIoControl"><span class="annot"><a href="System.Directory.Internal.Windows.html#c_DeviceIoControl"><span class="hs-identifier hs-var">c_DeviceIoControl</span></a></span></span><span>
</span><span id="line-272"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span>
</span><span id="line-273"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-274"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048511"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-275"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-276"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048510"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-277"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span>
</span><span id="line-279"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Void.html#Void"><span class="hs-identifier hs-type">Void</span></a></span><span>
</span><span id="line-280"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#BOOL"><span class="hs-identifier hs-type">Win32.BOOL</span></a></span></span></span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#readSymbolicLink"><span class="hs-identifier hs-type">readSymbolicLink</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-283"></span><span id="readSymbolicLink"><span class="annot"><span class="annottext">readSymbolicLink :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#readSymbolicLink"><span class="hs-identifier hs-var hs-var">readSymbolicLink</span></a></span></span><span> </span><span id="local-6989586621679048140"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048140"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-284"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048140"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO String -&gt; IO String
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-285"></span><span>    </span><span id="local-6989586621679048139"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048139"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048140"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-286"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679048136"><span class="annot"><span class="annottext">open :: IO HANDLE
</span><a href="#local-6989586621679048136"><span class="hs-identifier hs-var hs-var">open</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe LPSECURITY_ATTRIBUTES
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe HANDLE
-&gt; IO HANDLE
</span><a href="../../Win32/src/System.Win32.File.html#createFile"><span class="hs-identifier hs-var">Win32.createFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048139"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-var">maxShareMode</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LPSECURITY_ATTRIBUTES
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#oPEN_EXISTING"><span class="hs-identifier hs-var">Win32.oPEN_EXISTING</span></a></span><span>
</span><span id="line-287"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_FLAG_BACKUP_SEMANTICS"><span class="hs-identifier hs-var">Win32.fILE_FLAG_BACKUP_SEMANTICS</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span>
</span><span id="line-288"></span><span>                                </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fILE_FLAG_OPEN_REPARSE_POINT"><span class="hs-identifier hs-var">win32_fILE_FLAG_OPEN_REPARSE_POINT</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe HANDLE
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-289"></span><span>    </span><span class="annot"><span class="annottext">IO HANDLE
-&gt; (HANDLE -&gt; IO ()) -&gt; (HANDLE -&gt; IO String) -&gt; IO String
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="annot"><span class="annottext">IO HANDLE
</span><a href="#local-6989586621679048136"><span class="hs-identifier hs-var">open</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#closeHandle"><span class="hs-identifier hs-var">Win32.closeHandle</span></a></span><span> </span><span class="annot"><span class="annottext">((HANDLE -&gt; IO String) -&gt; IO String)
-&gt; (HANDLE -&gt; IO String) -&gt; IO String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679048135"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048135"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-290"></span><span>      </span><span class="annot"><span class="annottext">((Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO String) -&gt; IO String
forall a. ((Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO a) -&gt; IO a
</span><a href="System.Directory.Internal.Windows.html#win32_alloca_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">win32_alloca_REPARSE_DATA_BUFFER</span></a></span><span> </span><span class="annot"><span class="annottext">(((Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO String) -&gt; IO String)
-&gt; ((Ptr Win32_REPARSE_DATA_BUFFER, Int) -&gt; IO String) -&gt; IO String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679048134"><span class="annot"><span class="annottext">ptrAndSize :: (Ptr Win32_REPARSE_DATA_BUFFER, Int)
</span><a href="#local-6989586621679048134"><span class="hs-identifier hs-var">ptrAndSize</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679048133"><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048133"><span class="hs-identifier hs-var">ptr</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-291"></span><span>        </span><span id="local-6989586621679048132"><span class="annot"><span class="annottext">Either SHGetFolderPathFlags Int
</span><a href="#local-6989586621679048132"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HANDLE
-&gt; SHGetFolderPathFlags
-&gt; (Ptr Any, Int)
-&gt; (Ptr Win32_REPARSE_DATA_BUFFER, Int)
-&gt; Maybe Void
-&gt; IO (Either SHGetFolderPathFlags Int)
forall a b.
HANDLE
-&gt; SHGetFolderPathFlags
-&gt; (Ptr a, Int)
-&gt; (Ptr b, Int)
-&gt; Maybe Void
-&gt; IO (Either SHGetFolderPathFlags Int)
</span><a href="System.Directory.Internal.Windows.html#deviceIoControl"><span class="hs-identifier hs-var">deviceIoControl</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048135"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fSCTL_GET_REPARSE_POINT"><span class="hs-identifier hs-var">win32_fSCTL_GET_REPARSE_POINT</span></a></span><span>
</span><span id="line-292"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Any
forall {b}. Ptr b
</span><a href="../../base/src/GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Ptr Win32_REPARSE_DATA_BUFFER, Int)
</span><a href="#local-6989586621679048134"><span class="hs-identifier hs-var">ptrAndSize</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Void
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-293"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either SHGetFolderPathFlags Int
</span><a href="#local-6989586621679048132"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-294"></span><span>          </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679048131"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048131"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048131"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_FUNCTION"><span class="hs-identifier hs-var">win32_eRROR_INVALID_FUNCTION</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-295"></span><span>                     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679048129"><span class="annot"><span class="annottext">msg :: String
</span><a href="#local-6989586621679048129"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Incorrect function. The file system &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-296"></span><span>                               </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;might not support symbolic links.&quot;</span></span><span>
</span><span id="line-297"></span><span>                     </span><span class="annot"><span class="annottext">IOError -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOErrorType -&gt; String -&gt; Maybe Handle -&gt; Maybe String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#mkIOError"><span class="hs-identifier hs-var">mkIOError</span></a></span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/System.IO.Error.html#illegalOperationErrorType"><span class="hs-identifier hs-var">illegalOperationErrorType</span></a></span><span>
</span><span id="line-298"></span><span>                                        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;DeviceIoControl&quot;</span></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-299"></span><span>                              </span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetErrorString"><span class="hs-operator hs-var">`ioeSetErrorString`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048129"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO ()
forall a. String -&gt; SHGetFolderPathFlags -&gt; IO a
</span><a href="../../Win32/src/System.Win32.Types.html#failWith"><span class="hs-identifier hs-var">Win32.failWith</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;DeviceIoControl&quot;</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048131"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-301"></span><span>          </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>        </span><span id="local-6989586621679048123"><span class="annot"><span class="annottext">Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048123"><span class="hs-identifier hs-var">rData</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER -&gt; IO Win32_REPARSE_DATA_BUFFER
</span><a href="System.Directory.Internal.Windows.html#win32_peek_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-var">win32_peek_REPARSE_DATA_BUFFER</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048133"><span class="hs-identifier hs-var">ptr</span></a></span><span>
</span><span id="line-303"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679048122"><span class="hs-identifier hs-var">strip</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; IO String -&gt; IO String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Win32_REPARSE_DATA_BUFFER
</span><a href="#local-6989586621679048123"><span class="hs-identifier hs-var">rData</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-304"></span><span>          </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_MOUNT_POINT_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">Win32_MOUNT_POINT_REPARSE_DATA_BUFFER</span></a></span><span> </span><span id="local-6989586621679048121"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048121"><span class="hs-identifier hs-var">sn</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048121"><span class="hs-identifier hs-var">sn</span></a></span><span>
</span><span id="line-305"></span><span>          </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Win32_SYMLINK_REPARSE_DATA_BUFFER"><span class="hs-identifier hs-type">Win32_SYMLINK_REPARSE_DATA_BUFFER</span></a></span><span> </span><span id="local-6989586621679048120"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048120"><span class="hs-identifier hs-var">sn</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048120"><span class="hs-identifier hs-var">sn</span></a></span><span>
</span><span id="line-306"></span><span>          </span><span class="annot"><span class="annottext">Win32_REPARSE_DATA_BUFFER
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOError -&gt; IO String
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOErrorType -&gt; String -&gt; Maybe Handle -&gt; Maybe String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#mkIOError"><span class="hs-identifier hs-var">mkIOError</span></a></span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/GHC.IO.Exception.html#InappropriateType"><span class="hs-identifier hs-var">InappropriateType</span></a></span><span>
</span><span id="line-307"></span><span>                                  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;readSymbolicLink&quot;</span></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-309"></span><span>    </span><span id="local-6989586621679048122"><span class="annot"><span class="annottext">strip :: String -&gt; String
</span><a href="#local-6989586621679048122"><span class="hs-identifier hs-var hs-var">strip</span></a></span></span><span> </span><span id="local-6989586621679048116"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048116"><span class="hs-identifier hs-var">sn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String -&gt; String
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048116"><span class="hs-identifier hs-var">sn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Maybe [a]
</span><a href="../../base/src/Data.OldList.html#stripPrefix"><span class="hs-identifier hs-var">List.stripPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\\??\\&quot;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048116"><span class="hs-identifier hs-var">sn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span class="hs-comment">-- | On Windows, equivalent to 'simplifyWindows'.</span><span>
</span><span id="line-312"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#simplify"><span class="hs-identifier hs-type">simplify</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-313"></span><span id="simplify"><span class="annot"><span class="annottext">simplify :: String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#simplify"><span class="hs-identifier hs-var hs-var">simplify</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Common.html#simplifyWindows"><span class="hs-identifier hs-var">simplifyWindows</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span class="hs-comment">-- | Normalise the path separators and prepend the @&quot;\\\\?\\&quot;@ prefix if</span><span>
</span><span id="line-316"></span><span class="hs-comment">-- necessary or possible.  This is used for symbolic links targets because</span><span>
</span><span id="line-317"></span><span class="hs-comment">-- they can't handle forward slashes.</span><span>
</span><span id="line-318"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#normaliseSeparators"><span class="hs-identifier hs-type">normaliseSeparators</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-319"></span><span id="normaliseSeparators"><span class="annot"><span class="annottext">normaliseSeparators :: String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#normaliseSeparators"><span class="hs-identifier hs-var hs-var">normaliseSeparators</span></a></span></span><span> </span><span id="local-6989586621679048110"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">path</span></a></span></span><span>
</span><span id="line-320"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isRelative"><span class="hs-identifier hs-var">isRelative</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679048109"><span class="hs-identifier hs-var">normaliseSep</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; String -&gt; String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-var">toExtendedLengthPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679048109"><span class="annot"><span class="annottext">normaliseSep :: Char -&gt; Char
</span><a href="#local-6989586621679048109"><span class="hs-identifier hs-var hs-var">normaliseSep</span></a></span></span><span> </span><span id="local-6989586621679048108"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048108"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isPathSeparator"><span class="hs-identifier hs-var">isPathSeparator</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048108"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="../../filepath/src/System.FilePath.Windows.html#pathSeparator"><span class="hs-identifier hs-var">pathSeparator</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048108"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | 'simplify' the path and prepend the @&quot;\\\\?\\&quot;@ if possible.  This</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- function can sometimes be used to bypass the @MAX_PATH@ length restriction</span><span>
</span><span id="line-326"></span><span class="hs-comment">-- in Windows API calls.</span><span>
</span><span id="line-327"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-type">toExtendedLengthPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-328"></span><span id="toExtendedLengthPath"><span class="annot"><span class="annottext">toExtendedLengthPath :: String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-var hs-var">toExtendedLengthPath</span></a></span></span><span> </span><span id="local-6989586621679048107"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048107"><span class="hs-identifier hs-var">path</span></a></span></span><span>
</span><span id="line-329"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isRelative"><span class="hs-identifier hs-var">isRelative</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048107"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span>
</span><span id="line-330"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-331"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-332"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span>  </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span>
</span><span id="line-333"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span>
</span><span id="line-334"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span>
</span><span id="line-335"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679048105"><span class="annot"><span class="annottext">subpath :: String
</span><a href="#local-6989586621679048105"><span class="hs-identifier hs-var">subpath</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\\\\?\\UNC&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048105"><span class="hs-identifier hs-var">subpath</span></a></span><span>
</span><span id="line-336"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\\\\?\\&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">simplifiedPath</span></a></span><span>
</span><span id="line-337"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679048106"><span class="annot"><span class="annottext">simplifiedPath :: String
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var hs-var">simplifiedPath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#simplify"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048107"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span class="hs-comment">-- | Make a path absolute and convert to an extended length path, if possible.</span><span>
</span><span id="line-340"></span><span class="hs-comment">--</span><span>
</span><span id="line-341"></span><span class="hs-comment">-- Empty paths are left unchanged.</span><span>
</span><span id="line-342"></span><span class="hs-comment">--</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- This function never fails.  If it doesn't understand the path, it just</span><span>
</span><span id="line-344"></span><span class="hs-comment">-- returns the path unchanged.</span><span>
</span><span id="line-345"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-type">furnishPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-346"></span><span id="furnishPath"><span class="annot"><span class="annottext">furnishPath :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var hs-var">furnishPath</span></a></span></span><span> </span><span id="local-6989586621679048104"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-347"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-var">toExtendedLengthPath</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; IO String -&gt; IO String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#rawPrependCurrentDirectory"><span class="hs-identifier hs-var">rawPrependCurrentDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>    </span><span class="annot"><span class="annottext">IO String -&gt; (IOError -&gt; IO String) -&gt; IO String
forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#catchIOError"><span class="hs-operator hs-var">`catchIOError`</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">IOError
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-349"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span class="hs-comment">-- | Strip the @&quot;\\\\?\\&quot;@ prefix if possible.</span><span>
</span><span id="line-352"></span><span class="hs-comment">-- The prefix is kept if the meaning of the path would otherwise change.</span><span>
</span><span id="line-353"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#fromExtendedLengthPath"><span class="hs-identifier hs-type">fromExtendedLengthPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-354"></span><span id="fromExtendedLengthPath"><span class="annot"><span class="annottext">fromExtendedLengthPath :: String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#fromExtendedLengthPath"><span class="hs-identifier hs-var hs-var">fromExtendedLengthPath</span></a></span></span><span> </span><span id="local-6989586621679048101"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048101"><span class="hs-identifier hs-var">ePath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048101"><span class="hs-identifier hs-var">ePath</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-356"></span><span>    </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679048100"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048100"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-357"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048100"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-358"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'U'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'N'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'C'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679048099"><span class="annot"><span class="annottext">subpath :: String
</span><a href="#local-6989586621679048099"><span class="hs-identifier hs-var">subpath</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\\&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048099"><span class="hs-identifier hs-var">subpath</span></a></span><span>
</span><span id="line-359"></span><span>        </span><span id="local-6989586621679048098"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048098"><span class="hs-identifier hs-var">drive</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679048097"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048097"><span class="hs-identifier hs-var">subpath</span></a></span></span><span>
</span><span id="line-360"></span><span>          </span><span class="hs-comment">-- if the path is not &quot;regular&quot;, then the prefix is necessary</span><span>
</span><span id="line-361"></span><span>          </span><span class="hs-comment">-- to ensure the path is interpreted literally</span><span>
</span><span id="line-362"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isAlpha"><span class="hs-identifier hs-var">isAlpha</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048098"><span class="hs-identifier hs-var">drive</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isAscii"><span class="hs-identifier hs-var">isAscii</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048098"><span class="hs-identifier hs-var">drive</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="#local-6989586621679048093"><span class="hs-identifier hs-var">isPathRegular</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048097"><span class="hs-identifier hs-var">subpath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048100"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-363"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048101"><span class="hs-identifier hs-var">ePath</span></a></span><span>
</span><span id="line-364"></span><span>    </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048101"><span class="hs-identifier hs-var">ePath</span></a></span><span>
</span><span id="line-365"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-366"></span><span>    </span><span id="local-6989586621679048093"><span class="annot"><span class="annottext">isPathRegular :: String -&gt; Bool
</span><a href="#local-6989586621679048093"><span class="hs-identifier hs-var hs-var">isPathRegular</span></a></span></span><span> </span><span id="local-6989586621679048084"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048084"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-367"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048084"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span>
</span><span id="line-368"></span><span>           </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048084"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span>
</span><span id="line-369"></span><span>           </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;..&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048084"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getPathNameWith"><span class="hs-identifier hs-type">getPathNameWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-372"></span><span id="getPathNameWith"><span class="annot"><span class="annottext">getPathNameWith :: (Ptr CWchar -&gt; SHGetFolderPathFlags -&gt; IO SHGetFolderPathFlags)
-&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getPathNameWith"><span class="hs-identifier hs-var hs-var">getPathNameWith</span></a></span></span><span> </span><span id="local-6989586621679048080"><span class="annot"><span class="annottext">Ptr CWchar -&gt; SHGetFolderPathFlags -&gt; IO SHGetFolderPathFlags
</span><a href="#local-6989586621679048080"><span class="hs-identifier hs-var">cFunc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-373"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679048067"><span class="annot"><span class="annottext">getPathNameWithLen :: SHGetFolderPathFlags -&gt; IO (Either SHGetFolderPathFlags String)
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var hs-var">getPathNameWithLen</span></a></span></span><span> </span><span id="local-6989586621679048066"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-374"></span><span>        </span><span class="annot"><span class="annottext">Int
-&gt; (Ptr CWchar -&gt; IO (Either SHGetFolderPathFlags String))
-&gt; IO (Either SHGetFolderPathFlags String)
forall a b. Storable a =&gt; Int -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Foreign.Marshal.Array.html#allocaArray"><span class="hs-identifier hs-var">allocaArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Ptr CWchar -&gt; IO (Either SHGetFolderPathFlags String))
 -&gt; IO (Either SHGetFolderPathFlags String))
-&gt; (Ptr CWchar -&gt; IO (Either SHGetFolderPathFlags String))
-&gt; IO (Either SHGetFolderPathFlags String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679048064"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">ptrPathOut</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-375"></span><span>          </span><span id="local-6989586621679048063"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">len'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO SHGetFolderPathFlags -&gt; IO SHGetFolderPathFlags
forall a. (Eq a, Num a) =&gt; String -&gt; IO a -&gt; IO a
</span><a href="../../Win32/src/System.Win32.Types.html#failIfZero"><span class="hs-identifier hs-var">Win32.failIfZero</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr CWchar -&gt; SHGetFolderPathFlags -&gt; IO SHGetFolderPathFlags
</span><a href="#local-6989586621679048080"><span class="hs-identifier hs-var">cFunc</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">ptrPathOut</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">len'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-377"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either SHGetFolderPathFlags String
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Either SHGetFolderPathFlags String)
-&gt; IO String -&gt; IO (Either SHGetFolderPathFlags String)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CWStringLen -&gt; IO String
</span><a href="../../base/src/Foreign.C.String.html#peekCWStringLen"><span class="hs-identifier hs-var">peekCWStringLen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">ptrPathOut</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">len'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-378"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Either SHGetFolderPathFlags String
-&gt; IO (Either SHGetFolderPathFlags String)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Either SHGetFolderPathFlags String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">len'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>  </span><span id="local-6989586621679048060"><span class="annot"><span class="annottext">Either SHGetFolderPathFlags String
</span><a href="#local-6989586621679048060"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; IO (Either SHGetFolderPathFlags String)
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">getPathNameWithLen</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">260</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span class="hs-pragma">{-# LINE 380 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-380"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">r</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-381"></span><span>    </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pure</span><span> </span><span class="hs-identifier">s</span><span>
</span><span id="line-382"></span><span>    </span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-383"></span><span>      </span><span class="hs-identifier">r'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">getPathNameWithLen</span><span> </span><span class="hs-identifier">len</span><span>
</span><span id="line-384"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">r'</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-385"></span><span>        </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pure</span><span> </span><span class="hs-identifier">s</span><span>
</span><span id="line-386"></span><span>        </span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">throwIO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">mkIOError</span><span> </span><span class="hs-identifier">OtherError</span><span> </span><span class="hs-string">&quot;&quot;</span><span> </span><span class="hs-identifier">Nothing</span><span> </span><span class="hs-identifier">Nothing</span><span>
</span><span id="line-387"></span><span>                           </span><span class="hs-special">`</span><span class="hs-identifier">ioeSetErrorString</span><span class="hs-special">`</span><span> </span><span class="hs-string">&quot;path changed unexpectedly&quot;</span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#canonicalizePathWith"><span class="hs-identifier hs-type">canonicalizePathWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-391"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-392"></span><span id="canonicalizePathWith"><span class="annot"><span class="annottext">canonicalizePathWith :: ((String -&gt; IO String) -&gt; String -&gt; IO String)
-&gt; String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#canonicalizePathWith"><span class="hs-identifier hs-var hs-var">canonicalizePathWith</span></a></span></span><span> </span><span id="local-6989586621679048052"><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; String -&gt; IO String
</span><a href="#local-6989586621679048052"><span class="hs-identifier hs-var">attemptRealpath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; String -&gt; IO String
</span><a href="#local-6989586621679048052"><span class="hs-identifier hs-var">attemptRealpath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFinalPathName"><span class="hs-identifier hs-var">getFinalPathName</span></a></span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#canonicalizePathSimplify"><span class="hs-identifier hs-type">canonicalizePathSimplify</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-395"></span><span id="canonicalizePathSimplify"><span class="annot"><span class="annottext">canonicalizePathSimplify :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#canonicalizePathSimplify"><span class="hs-identifier hs-var hs-var">canonicalizePathSimplify</span></a></span></span><span> </span><span id="local-6989586621679048050"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048050"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-396"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFullPathName"><span class="hs-identifier hs-var">getFullPathName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048050"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-397"></span><span>    </span><span class="annot"><span class="annottext">IO String -&gt; (IOError -&gt; IO String) -&gt; IO String
forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#catchIOError"><span class="hs-operator hs-var">`catchIOError`</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">IOError
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-398"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048050"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#searchPathEnvForExes"><span class="hs-identifier hs-type">searchPathEnvForExes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span id="searchPathEnvForExes"><span class="annot"><span class="annottext">searchPathEnvForExes :: String -&gt; IO (Maybe String)
</span><a href="System.Directory.Internal.Windows.html#searchPathEnvForExes"><span class="hs-identifier hs-var hs-var">searchPathEnvForExes</span></a></span></span><span> </span><span id="local-6989586621679048047"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048047"><span class="hs-identifier hs-var">binary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; String -&gt; Maybe String -&gt; IO (Maybe String)
</span><a href="../../Win32/src/System.Win32.Info.html#searchPath"><span class="hs-identifier hs-var">Win32.searchPath</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048047"><span class="hs-identifier hs-var">binary</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe String -&gt; IO (Maybe String))
-&gt; Maybe String -&gt; IO (Maybe String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span class="hs-pragma">{-# LINE 403 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-403"></span><span>  </span><span class="hs-identifier">Just</span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="hs-pragma">{-# LINE 405 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-405"></span><span>  </span><span class="hs-identifier">exeExtension</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#findExecutablesLazyInternal"><span class="hs-identifier hs-type">findExecutablesLazyInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-409"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-410"></span><span id="findExecutablesLazyInternal"><span class="annot"><span class="annottext">findExecutablesLazyInternal :: ([String] -&gt; String -&gt; ListT IO String)
-&gt; String -&gt; ListT IO String
</span><a href="System.Directory.Internal.Windows.html#findExecutablesLazyInternal"><span class="hs-identifier hs-var hs-var">findExecutablesLazyInternal</span></a></span></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String -&gt; ListT IO String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Maybe String) -&gt; ListT IO String
forall (m :: * -&gt; *) a. Applicative m =&gt; m (Maybe a) -&gt; ListT m a
</span><a href="System.Directory.Internal.Common.html#maybeToListT"><span class="hs-identifier hs-var">maybeToListT</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe String) -&gt; ListT IO String)
-&gt; (String -&gt; IO (Maybe String)) -&gt; String -&gt; ListT IO String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO (Maybe String)
</span><a href="System.Directory.Internal.Windows.html#searchPathEnvForExes"><span class="hs-identifier hs-var">searchPathEnvForExes</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#exeExtensionInternal"><span class="hs-identifier hs-type">exeExtensionInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-413"></span><span id="exeExtensionInternal"><span class="annot"><span class="annottext">exeExtensionInternal :: String
</span><a href="System.Directory.Internal.Windows.html#exeExtensionInternal"><span class="hs-identifier hs-var hs-var">exeExtensionInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="System.Directory.Internal.Config.html#exeExtension"><span class="hs-identifier hs-var">exeExtension</span></a></span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getDirectoryContentsInternal"><span class="hs-identifier hs-type">getDirectoryContentsInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-416"></span><span id="getDirectoryContentsInternal"><span class="annot"><span class="annottext">getDirectoryContentsInternal :: String -&gt; IO [String]
</span><a href="System.Directory.Internal.Windows.html#getDirectoryContentsInternal"><span class="hs-identifier hs-var hs-var">getDirectoryContentsInternal</span></a></span></span><span> </span><span id="local-6989586621679048041"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048041"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-417"></span><span>  </span><span id="local-6989586621679048040"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048040"><span class="hs-identifier hs-var">query</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048041"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-418"></span><span>  </span><span class="annot"><span class="annottext">IO (HANDLE, FindData)
-&gt; ((HANDLE, FindData) -&gt; IO ())
-&gt; ((HANDLE, FindData) -&gt; IO [String])
-&gt; IO [String]
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span>
</span><span id="line-419"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IO (HANDLE, FindData)
</span><a href="../../Win32/src/System.Win32.File.html#findFirstFile"><span class="hs-identifier hs-var">Win32.findFirstFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048040"><span class="hs-identifier hs-var">query</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-420"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048038"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048038"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FindData
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#findClose"><span class="hs-identifier hs-var">Win32.findClose</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048038"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048036"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048036"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048035"><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048035"><span class="hs-identifier hs-var">fdat</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; FindData -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679048034"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048036"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048035"><span class="hs-identifier hs-var">fdat</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-423"></span><span>    </span><span class="hs-comment">-- we needn't worry about empty directories: a directory always</span><span>
</span><span id="line-424"></span><span>    </span><span class="hs-comment">-- has at least &quot;.&quot; and &quot;..&quot; entries</span><span>
</span><span id="line-425"></span><span>    </span><span class="annot"><a href="#local-6989586621679048034"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#FindData"><span class="hs-identifier hs-type">Win32.FindData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-426"></span><span>    </span><span id="local-6989586621679048034"><span class="annot"><span class="annottext">loop :: HANDLE -&gt; FindData -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679048034"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679048033"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048033"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621679048032"><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048032"><span class="hs-identifier hs-var">fdat</span></a></span></span><span> </span><span id="local-6989586621679048031"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679048031"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-427"></span><span>      </span><span id="local-6989586621679048030"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048030"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FindData -&gt; IO String
</span><a href="../../Win32/src/System.Win32.File.html#getFindDataFileName"><span class="hs-identifier hs-var">Win32.getFindDataFileName</span></a></span><span> </span><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048032"><span class="hs-identifier hs-var">fdat</span></a></span><span>
</span><span id="line-428"></span><span>      </span><span id="local-6989586621679048028"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048028"><span class="hs-identifier hs-var">more</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; FindData -&gt; IO Bool
</span><a href="../../Win32/src/System.Win32.File.html#findNextFile"><span class="hs-identifier hs-var">Win32.findNextFile</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048033"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048032"><span class="hs-identifier hs-var">fdat</span></a></span><span>
</span><span id="line-429"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048028"><span class="hs-identifier hs-var">more</span></a></span><span>
</span><span id="line-430"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; FindData -&gt; [String] -&gt; IO [String]
</span><a href="#local-6989586621679048034"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679048033"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">FindData
</span><a href="#local-6989586621679048032"><span class="hs-identifier hs-var">fdat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048030"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679048031"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048030"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679048031"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>             </span><span class="hs-comment">-- no need to reverse, ordering is undefined</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getCurrentDirectoryInternal"><span class="hs-identifier hs-type">getCurrentDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-435"></span><span id="getCurrentDirectoryInternal"><span class="annot"><span class="annottext">getCurrentDirectoryInternal :: IO String
</span><a href="System.Directory.Internal.Windows.html#getCurrentDirectoryInternal"><span class="hs-identifier hs-var hs-var">getCurrentDirectoryInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../Win32/src/System.Win32.Info.html#getCurrentDirectory"><span class="hs-identifier hs-var">Win32.getCurrentDirectory</span></a></span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getFullPathName"><span class="hs-identifier hs-type">getFullPathName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-438"></span><span id="getFullPathName"><span class="annot"><span class="annottext">getFullPathName :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFullPathName"><span class="hs-identifier hs-var hs-var">getFullPathName</span></a></span></span><span> </span><span id="local-6989586621679048024"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048024"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-439"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#fromExtendedLengthPath"><span class="hs-identifier hs-var">fromExtendedLengthPath</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; IO String -&gt; IO String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="../../Win32/src/System.Win32.Info.html#getFullPathName"><span class="hs-identifier hs-var">Win32.getFullPathName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#toExtendedLengthPath"><span class="hs-identifier hs-var">toExtendedLengthPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048024"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span class="hs-comment">-- | Similar to 'prependCurrentDirectory' but fails for empty paths.</span><span>
</span><span id="line-442"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#rawPrependCurrentDirectory"><span class="hs-identifier hs-type">rawPrependCurrentDirectory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-443"></span><span id="rawPrependCurrentDirectory"><span class="annot"><span class="annottext">rawPrependCurrentDirectory :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#rawPrependCurrentDirectory"><span class="hs-identifier hs-var hs-var">rawPrependCurrentDirectory</span></a></span></span><span> </span><span id="local-6989586621679048022"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">path</span></a></span></span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isRelative"><span class="hs-identifier hs-var">isRelative</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-445"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="System.Directory.Internal.Common.html#ioeAddLocation"><span class="hs-operator hs-var">`ioeAddLocation`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;prependCurrentDirectory&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; (IOError -&gt; IOError) -&gt; IOError -&gt; IOError
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span>
</span><span id="line-446"></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO String -&gt; IO String
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-447"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFullPathName"><span class="hs-identifier hs-var">getFullPathName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-448"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span class="hs-comment">-- | Convert a path into an absolute path.  If the given path is relative, the</span><span>
</span><span id="line-451"></span><span class="hs-comment">-- current directory is prepended and the path may or may not be simplified.</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- If the path is already absolute, the path is returned unchanged.  The</span><span>
</span><span id="line-453"></span><span class="hs-comment">-- function preserves the presence or absence of the trailing path separator.</span><span>
</span><span id="line-454"></span><span class="hs-comment">--</span><span>
</span><span id="line-455"></span><span class="hs-comment">-- If the path is already absolute, the operation never fails.  Otherwise, the</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- operation may throw exceptions.</span><span>
</span><span id="line-457"></span><span class="hs-comment">--</span><span>
</span><span id="line-458"></span><span class="hs-comment">-- Empty paths are treated as the current directory.</span><span>
</span><span id="line-459"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#prependCurrentDirectory"><span class="hs-identifier hs-type">prependCurrentDirectory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-460"></span><span id="prependCurrentDirectory"><span class="annot"><span class="annottext">prependCurrentDirectory :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#prependCurrentDirectory"><span class="hs-identifier hs-var hs-var">prependCurrentDirectory</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#rawPrependCurrentDirectory"><span class="hs-identifier hs-var">rawPrependCurrentDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; (String -&gt; String) -&gt; String -&gt; IO String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Common.html#emptyToCurDir"><span class="hs-identifier hs-var">emptyToCurDir</span></a></span><span>
</span><span id="line-461"></span><span>
</span><span id="line-462"></span><span class="hs-comment">-- SetCurrentDirectory does not support long paths even with the \\?\ prefix</span><span>
</span><span id="line-463"></span><span class="hs-comment">-- https://ghc.haskell.org/trac/ghc/ticket/13373#comment:6</span><span>
</span><span id="line-464"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setCurrentDirectoryInternal"><span class="hs-identifier hs-type">setCurrentDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span id="setCurrentDirectoryInternal"><span class="annot"><span class="annottext">setCurrentDirectoryInternal :: String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setCurrentDirectoryInternal"><span class="hs-identifier hs-var hs-var">setCurrentDirectoryInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#setCurrentDirectory"><span class="hs-identifier hs-var">Win32.setCurrentDirectory</span></a></span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#createSymbolicLinkUnpriv"><span class="hs-identifier hs-type">createSymbolicLinkUnpriv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span id="createSymbolicLinkUnpriv"><span class="annot"><span class="annottext">createSymbolicLinkUnpriv :: String -&gt; String -&gt; Bool -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#createSymbolicLinkUnpriv"><span class="hs-identifier hs-var hs-var">createSymbolicLinkUnpriv</span></a></span></span><span> </span><span id="local-6989586621679048015"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048015"><span class="hs-identifier hs-var">link</span></a></span></span><span> </span><span id="local-6989586621679048014"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048014"><span class="hs-identifier hs-var">_target</span></a></span></span><span> </span><span id="local-6989586621679048013"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048013"><span class="hs-identifier hs-var">_isDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-pragma">{-# LINE 470 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-470"></span><span>  </span><span class="hs-identifier">withCWString</span><span> </span><span class="hs-identifier">link</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">pLink</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-471"></span><span>  </span><span class="hs-identifier">withCWString</span><span> </span><span class="hs-identifier">_target</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">pTarget</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-472"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">_isDir</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">win32_sYMBOLIC_LINK_FLAG_DIRECTORY</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-473"></span><span>    </span><span class="hs-identifier">call</span><span> </span><span class="hs-identifier">pLink</span><span> </span><span class="hs-identifier">pTarget</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">win32_sYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE</span><span>
</span><span id="line-474"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-475"></span><span>    </span><span id="local-6989586621679048007"><span class="annot"><span class="annottext">call :: Ptr CWchar
-&gt; Ptr CWchar
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; IO ()
</span><a href="#local-6989586621679048007"><span class="hs-identifier hs-var hs-var">call</span></a></span></span><span> </span><span id="local-6989586621679047990"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">pLink</span></a></span></span><span> </span><span id="local-6989586621679047989"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047989"><span class="hs-identifier hs-var">pTarget</span></a></span></span><span> </span><span id="local-6989586621679047988"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047988"><span class="hs-identifier hs-var">flags</span></a></span></span><span> </span><span id="local-6989586621679047987"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047987"><span class="hs-identifier hs-var">unpriv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-476"></span><span>      </span><span id="local-6989586621679047986"><span class="annot"><span class="annottext">BYTE
</span><a href="#local-6989586621679047986"><span class="hs-identifier hs-var">status</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr CWchar -&gt; Ptr CWchar -&gt; SHGetFolderPathFlags -&gt; IO BYTE
</span><a href="System.Directory.Internal.Windows.html#c_CreateSymbolicLink"><span class="hs-identifier hs-var">c_CreateSymbolicLink</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">pLink</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047989"><span class="hs-identifier hs-var">pTarget</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047988"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047987"><span class="hs-identifier hs-var">unpriv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BYTE
</span><a href="#local-6989586621679047986"><span class="hs-identifier hs-var">status</span></a></span><span> </span><span class="annot"><span class="annottext">BYTE -&gt; BYTE -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BYTE
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-478"></span><span>        </span><span id="local-6989586621679047983"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.Types.html#getLastError"><span class="hs-identifier hs-var">Win32.getLastError</span></a></span><span>
</span><span id="line-479"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-480"></span><span>          </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_FUNCTION"><span class="hs-identifier hs-var">win32_eRROR_INVALID_FUNCTION</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-481"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047981"><span class="annot"><span class="annottext">msg :: String
</span><a href="#local-6989586621679047981"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Incorrect function. The underlying file system &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-482"></span><span>                          </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;might not support symbolic links.&quot;</span></span><span>
</span><span id="line-483"></span><span>                </span><span class="annot"><span class="annottext">IOError -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOErrorType -&gt; String -&gt; Maybe Handle -&gt; Maybe String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#mkIOError"><span class="hs-identifier hs-var">mkIOError</span></a></span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/System.IO.Error.html#illegalOperationErrorType"><span class="hs-identifier hs-var">illegalOperationErrorType</span></a></span><span>
</span><span id="line-484"></span><span>                                   </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CreateSymbolicLink&quot;</span></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048015"><span class="hs-identifier hs-var">link</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>                         </span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetErrorString"><span class="hs-operator hs-var">`ioeSetErrorString`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047981"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-486"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_PRIVILEGE_NOT_HELD"><span class="hs-identifier hs-var">win32_eRROR_PRIVILEGE_NOT_HELD</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-487"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047978"><span class="annot"><span class="annottext">msg :: String
</span><a href="#local-6989586621679047978"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A required privilege is not held by the client. &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-488"></span><span>                          </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Creating symbolic links usually requires &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-489"></span><span>                          </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;administrative rights.&quot;</span></span><span>
</span><span id="line-490"></span><span>                </span><span class="annot"><span class="annottext">IOError -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOErrorType -&gt; String -&gt; Maybe Handle -&gt; Maybe String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#mkIOError"><span class="hs-identifier hs-var">mkIOError</span></a></span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/System.IO.Error.html#permissionErrorType"><span class="hs-identifier hs-var">permissionErrorType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CreateSymbolicLink&quot;</span></span><span>
</span><span id="line-491"></span><span>                                   </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048015"><span class="hs-identifier hs-var">link</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span>                         </span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetErrorString"><span class="hs-operator hs-var">`ioeSetErrorString`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047978"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-493"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_eRROR_INVALID_PARAMETER"><span class="hs-identifier hs-var">win32_eRROR_INVALID_PARAMETER</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-494"></span><span>              </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047987"><span class="hs-identifier hs-var">unpriv</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-495"></span><span>                </span><span class="hs-comment">-- for compatibility with older versions of Windows,</span><span>
</span><span id="line-496"></span><span>                </span><span class="hs-comment">-- try it again without the flag</span><span>
</span><span id="line-497"></span><span>                </span><span class="annot"><span class="annottext">Ptr CWchar
-&gt; Ptr CWchar
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; IO ()
</span><a href="#local-6989586621679048007"><span class="hs-identifier hs-var">call</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">pLink</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679047989"><span class="hs-identifier hs-var">pTarget</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047988"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span>
</span><span id="line-498"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO ()
forall a. String -&gt; SHGetFolderPathFlags -&gt; IO a
</span><a href="../../Win32/src/System.Win32.Types.html#failWith"><span class="hs-identifier hs-var">Win32.failWith</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CreateSymbolicLink&quot;</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINAPI</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h CreateSymbolicLinkW&quot;</span><span>
</span><span id="line-501"></span><span>  </span><span id="c_CreateSymbolicLink"><span class="annot"><a href="System.Directory.Internal.Windows.html#c_CreateSymbolicLink"><span class="hs-identifier hs-var">c_CreateSymbolicLink</span></a></span></span><span>
</span><span id="line-502"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CWchar"><span class="hs-identifier hs-type">CWchar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">Win32.DWORD</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#BYTE"><span class="hs-identifier hs-type">Win32.BYTE</span></a></span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span>
</span><span id="line-505"></span><span class="hs-pragma">{-# LINE 510 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#linkToDirectoryIsDirectory"><span class="hs-identifier hs-type">linkToDirectoryIsDirectory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-512"></span><span id="linkToDirectoryIsDirectory"><span class="annot"><span class="annottext">linkToDirectoryIsDirectory :: Bool
</span><a href="System.Directory.Internal.Windows.html#linkToDirectoryIsDirectory"><span class="hs-identifier hs-var hs-var">linkToDirectoryIsDirectory</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-513"></span><span>
</span><span id="line-514"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#createSymbolicLink"><span class="hs-identifier hs-type">createSymbolicLink</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-515"></span><span id="createSymbolicLink"><span class="annot"><span class="annottext">createSymbolicLink :: Bool -&gt; String -&gt; String -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#createSymbolicLink"><span class="hs-identifier hs-var hs-var">createSymbolicLink</span></a></span></span><span> </span><span id="local-6989586621679047974"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047974"><span class="hs-identifier hs-var">isDir</span></a></span></span><span> </span><span id="local-6989586621679047973"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047973"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span id="local-6989586621679047972"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047972"><span class="hs-identifier hs-var">link</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-516"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047972"><span class="hs-identifier hs-var">link</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-517"></span><span>    </span><span class="hs-comment">-- normaliseSeparators ensures the target gets normalised properly</span><span>
</span><span id="line-518"></span><span>    </span><span id="local-6989586621679047971"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047971"><span class="hs-identifier hs-var">link'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047972"><span class="hs-identifier hs-var">link</span></a></span><span>
</span><span id="line-519"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#createSymbolicLinkUnpriv"><span class="hs-identifier hs-var">createSymbolicLinkUnpriv</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047971"><span class="hs-identifier hs-var">link'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Directory.Internal.Windows.html#normaliseSeparators"><span class="hs-identifier hs-var">normaliseSeparators</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047973"><span class="hs-identifier hs-var">target</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047974"><span class="hs-identifier hs-var">isDir</span></a></span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="hs-keyword">type</span><span> </span><span id="Metadata"><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-var">Metadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#BY_HANDLE_FILE_INFORMATION"><span class="hs-identifier hs-type">Win32.BY_HANDLE_FILE_INFORMATION</span></a></span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getSymbolicLinkMetadata"><span class="hs-identifier hs-type">getSymbolicLinkMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span>
</span><span id="line-524"></span><span id="getSymbolicLinkMetadata"><span class="annot"><span class="annottext">getSymbolicLinkMetadata :: String -&gt; IO Metadata
</span><a href="System.Directory.Internal.Windows.html#getSymbolicLinkMetadata"><span class="hs-identifier hs-var hs-var">getSymbolicLinkMetadata</span></a></span></span><span> </span><span id="local-6989586621679047968"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047968"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-525"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047968"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO Metadata -&gt; IO Metadata
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-526"></span><span>    </span><span id="local-6989586621679047967"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047967"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047968"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-527"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047964"><span class="annot"><span class="annottext">open :: IO HANDLE
</span><a href="#local-6989586621679047964"><span class="hs-identifier hs-var hs-var">open</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe LPSECURITY_ATTRIBUTES
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe HANDLE
-&gt; IO HANDLE
</span><a href="../../Win32/src/System.Win32.File.html#createFile"><span class="hs-identifier hs-var">Win32.createFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047967"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-var">maxShareMode</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LPSECURITY_ATTRIBUTES
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#oPEN_EXISTING"><span class="hs-identifier hs-var">Win32.oPEN_EXISTING</span></a></span><span>
</span><span id="line-528"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_FLAG_BACKUP_SEMANTICS"><span class="hs-identifier hs-var">Win32.fILE_FLAG_BACKUP_SEMANTICS</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span>
</span><span id="line-529"></span><span>                                 </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fILE_FLAG_OPEN_REPARSE_POINT"><span class="hs-identifier hs-var">win32_fILE_FLAG_OPEN_REPARSE_POINT</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe HANDLE
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-530"></span><span>    </span><span class="annot"><span class="annottext">IO HANDLE
-&gt; (HANDLE -&gt; IO ()) -&gt; (HANDLE -&gt; IO Metadata) -&gt; IO Metadata
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="annot"><span class="annottext">IO HANDLE
</span><a href="#local-6989586621679047964"><span class="hs-identifier hs-var">open</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#closeHandle"><span class="hs-identifier hs-var">Win32.closeHandle</span></a></span><span> </span><span class="annot"><span class="annottext">((HANDLE -&gt; IO Metadata) -&gt; IO Metadata)
-&gt; (HANDLE -&gt; IO Metadata) -&gt; IO Metadata
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679047963"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679047963"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-531"></span><span>      </span><span class="annot"><span class="annottext">HANDLE -&gt; IO Metadata
</span><a href="../../Win32/src/System.Win32.File.html#getFileInformationByHandle"><span class="hs-identifier hs-var">Win32.getFileInformationByHandle</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679047963"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-532"></span><span>
</span><span id="line-533"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getFileMetadata"><span class="hs-identifier hs-type">getFileMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span>
</span><span id="line-534"></span><span id="getFileMetadata"><span class="annot"><span class="annottext">getFileMetadata :: String -&gt; IO Metadata
</span><a href="System.Directory.Internal.Windows.html#getFileMetadata"><span class="hs-identifier hs-var hs-var">getFileMetadata</span></a></span></span><span> </span><span id="local-6989586621679047960"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047960"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-535"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047960"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO Metadata -&gt; IO Metadata
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-536"></span><span>    </span><span id="local-6989586621679047959"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047959"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047960"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-537"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047957"><span class="annot"><span class="annottext">open :: IO HANDLE
</span><a href="#local-6989586621679047957"><span class="hs-identifier hs-var hs-var">open</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe LPSECURITY_ATTRIBUTES
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe HANDLE
-&gt; IO HANDLE
</span><a href="../../Win32/src/System.Win32.File.html#createFile"><span class="hs-identifier hs-var">Win32.createFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047959"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-var">maxShareMode</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LPSECURITY_ATTRIBUTES
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#oPEN_EXISTING"><span class="hs-identifier hs-var">Win32.oPEN_EXISTING</span></a></span><span>
</span><span id="line-538"></span><span>                                </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_FLAG_BACKUP_SEMANTICS"><span class="hs-identifier hs-var">Win32.fILE_FLAG_BACKUP_SEMANTICS</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe HANDLE
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-539"></span><span>    </span><span class="annot"><span class="annottext">IO HANDLE
-&gt; (HANDLE -&gt; IO ()) -&gt; (HANDLE -&gt; IO Metadata) -&gt; IO Metadata
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="annot"><span class="annottext">IO HANDLE
</span><a href="#local-6989586621679047957"><span class="hs-identifier hs-var">open</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#closeHandle"><span class="hs-identifier hs-var">Win32.closeHandle</span></a></span><span> </span><span class="annot"><span class="annottext">((HANDLE -&gt; IO Metadata) -&gt; IO Metadata)
-&gt; (HANDLE -&gt; IO Metadata) -&gt; IO Metadata
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679047956"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679047956"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-540"></span><span>      </span><span class="annot"><span class="annottext">HANDLE -&gt; IO Metadata
</span><a href="../../Win32/src/System.Win32.File.html#getFileInformationByHandle"><span class="hs-identifier hs-var">Win32.getFileInformationByHandle</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679047956"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-541"></span><span>
</span><span id="line-542"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#fileTypeFromMetadata"><span class="hs-identifier hs-type">fileTypeFromMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#FileType"><span class="hs-identifier hs-type">FileType</span></a></span><span>
</span><span id="line-543"></span><span id="fileTypeFromMetadata"><span class="annot"><span class="annottext">fileTypeFromMetadata :: Metadata -&gt; FileType
</span><a href="System.Directory.Internal.Windows.html#fileTypeFromMetadata"><span class="hs-identifier hs-var hs-var">fileTypeFromMetadata</span></a></span></span><span> </span><span id="local-6989586621679047954"><span class="annot"><span class="annottext">Metadata
</span><a href="#local-6989586621679047954"><span class="hs-identifier hs-var">info</span></a></span></span><span>
</span><span id="line-544"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047953"><span class="hs-identifier hs-var">isLink</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047952"><span class="hs-identifier hs-var">isDir</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FileType
</span><a href="System.Directory.Internal.Common.html#DirectoryLink"><span class="hs-identifier hs-var">DirectoryLink</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">FileType
</span><a href="System.Directory.Internal.Common.html#SymbolicLink"><span class="hs-identifier hs-var">SymbolicLink</span></a></span><span>
</span><span id="line-545"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047952"><span class="hs-identifier hs-var">isDir</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FileType
</span><a href="System.Directory.Internal.Common.html#Directory"><span class="hs-identifier hs-var">Directory</span></a></span><span>
</span><span id="line-546"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FileType
</span><a href="System.Directory.Internal.Common.html#File"><span class="hs-identifier hs-var">File</span></a></span><span>
</span><span id="line-547"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-548"></span><span>    </span><span id="local-6989586621679047953"><span class="annot"><span class="annottext">isLink :: Bool
</span><a href="#local-6989586621679047953"><span class="hs-identifier hs-var hs-var">isLink</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047944"><span class="hs-identifier hs-var">attrs</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#win32_fILE_ATTRIBUTE_REPARSE_POINT"><span class="hs-identifier hs-var">win32_fILE_ATTRIBUTE_REPARSE_POINT</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span>
</span><span id="line-549"></span><span>    </span><span id="local-6989586621679047952"><span class="annot"><span class="annottext">isDir :: Bool
</span><a href="#local-6989586621679047952"><span class="hs-identifier hs-var hs-var">isDir</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047944"><span class="hs-identifier hs-var">attrs</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_DIRECTORY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_DIRECTORY</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span>
</span><span id="line-550"></span><span>    </span><span id="local-6989586621679047944"><span class="annot"><span class="annottext">attrs :: SHGetFolderPathFlags
</span><a href="#local-6989586621679047944"><span class="hs-identifier hs-var hs-var">attrs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#bhfiFileAttributes"><span class="hs-identifier hs-var hs-var">Win32.bhfiFileAttributes</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata
</span><a href="#local-6989586621679047954"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#fileSizeFromMetadata"><span class="hs-identifier hs-type">fileSizeFromMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-553"></span><span id="fileSizeFromMetadata"><span class="annot"><span class="annottext">fileSizeFromMetadata :: Metadata -&gt; Integer
</span><a href="System.Directory.Internal.Windows.html#fileSizeFromMetadata"><span class="hs-identifier hs-var hs-var">fileSizeFromMetadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DDWORD -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(DDWORD -&gt; Integer) -&gt; (Metadata -&gt; DDWORD) -&gt; Metadata -&gt; Integer
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; DDWORD
</span><a href="../../Win32/src/System.Win32.File.html#bhfiSize"><span class="hs-identifier hs-var hs-var">Win32.bhfiSize</span></a></span><span>
</span><span id="line-554"></span><span>
</span><span id="line-555"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#accessTimeFromMetadata"><span class="hs-identifier hs-type">accessTimeFromMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span>
</span><span id="line-556"></span><span id="accessTimeFromMetadata"><span class="annot"><span class="annottext">accessTimeFromMetadata :: Metadata -&gt; UTCTime
</span><a href="System.Directory.Internal.Windows.html#accessTimeFromMetadata"><span class="hs-identifier hs-var hs-var">accessTimeFromMetadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-557"></span><span>  </span><span class="annot"><span class="annottext">POSIXTime -&gt; UTCTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#posixSecondsToUTCTime"><span class="hs-identifier hs-var">posixSecondsToUTCTime</span></a></span><span> </span><span class="annot"><span class="annottext">(POSIXTime -&gt; UTCTime)
-&gt; (Metadata -&gt; POSIXTime) -&gt; Metadata -&gt; UTCTime
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FILETIME -&gt; POSIXTime
</span><a href="System.Directory.Internal.Windows.html#windowsToPosixTime"><span class="hs-identifier hs-var">windowsToPosixTime</span></a></span><span> </span><span class="annot"><span class="annottext">(FILETIME -&gt; POSIXTime)
-&gt; (Metadata -&gt; FILETIME) -&gt; Metadata -&gt; POSIXTime
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; FILETIME
</span><a href="../../Win32/src/System.Win32.File.html#bhfiLastAccessTime"><span class="hs-identifier hs-var hs-var">Win32.bhfiLastAccessTime</span></a></span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#modificationTimeFromMetadata"><span class="hs-identifier hs-type">modificationTimeFromMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span>
</span><span id="line-560"></span><span id="modificationTimeFromMetadata"><span class="annot"><span class="annottext">modificationTimeFromMetadata :: Metadata -&gt; UTCTime
</span><a href="System.Directory.Internal.Windows.html#modificationTimeFromMetadata"><span class="hs-identifier hs-var hs-var">modificationTimeFromMetadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-561"></span><span>  </span><span class="annot"><span class="annottext">POSIXTime -&gt; UTCTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#posixSecondsToUTCTime"><span class="hs-identifier hs-var">posixSecondsToUTCTime</span></a></span><span> </span><span class="annot"><span class="annottext">(POSIXTime -&gt; UTCTime)
-&gt; (Metadata -&gt; POSIXTime) -&gt; Metadata -&gt; UTCTime
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FILETIME -&gt; POSIXTime
</span><a href="System.Directory.Internal.Windows.html#windowsToPosixTime"><span class="hs-identifier hs-var">windowsToPosixTime</span></a></span><span> </span><span class="annot"><span class="annottext">(FILETIME -&gt; POSIXTime)
-&gt; (Metadata -&gt; FILETIME) -&gt; Metadata -&gt; POSIXTime
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; FILETIME
</span><a href="../../Win32/src/System.Win32.File.html#bhfiLastWriteTime"><span class="hs-identifier hs-var hs-var">Win32.bhfiLastWriteTime</span></a></span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span class="hs-comment">-- | Difference between the Windows and POSIX epochs in units of 100ns.</span><span>
</span><span id="line-564"></span><span id="local-6989586621679048480"><span class="annot"><a href="System.Directory.Internal.Windows.html#windowsPosixEpochDifference"><span class="hs-identifier hs-type">windowsPosixEpochDifference</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048480"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679048480"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-565"></span><span id="windowsPosixEpochDifference"><span class="annot"><span class="annottext">windowsPosixEpochDifference :: forall a. Num a =&gt; a
</span><a href="System.Directory.Internal.Windows.html#windowsPosixEpochDifference"><span class="hs-identifier hs-var hs-var">windowsPosixEpochDifference</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">116444736000000000</span></span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span class="hs-comment">-- | Convert from Windows time to POSIX time.</span><span>
</span><span id="line-568"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#windowsToPosixTime"><span class="hs-identifier hs-type">windowsToPosixTime</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Time.html#FILETIME"><span class="hs-identifier hs-type">Win32.FILETIME</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span>
</span><span id="line-569"></span><span id="windowsToPosixTime"><span class="annot"><span class="annottext">windowsToPosixTime :: FILETIME -&gt; POSIXTime
</span><a href="System.Directory.Internal.Windows.html#windowsToPosixTime"><span class="hs-identifier hs-var hs-var">windowsToPosixTime</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../Win32/src/System.Win32.Time.html#FILETIME"><span class="hs-identifier hs-type">Win32.FILETIME</span></a></span><span> </span><span id="local-6989586621679047927"><span class="annot"><span class="annottext">DDWORD
</span><a href="#local-6989586621679047927"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-570"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DDWORD -&gt; POSIXTime
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">DDWORD
</span><a href="#local-6989586621679047927"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime -&gt; POSIXTime -&gt; POSIXTime
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
forall a. Num a =&gt; a
</span><a href="System.Directory.Internal.Windows.html#windowsPosixEpochDifference"><span class="hs-identifier hs-var">windowsPosixEpochDifference</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">POSIXTime -&gt; POSIXTime -&gt; POSIXTime
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><span class="hs-number">10000000</span></span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span class="hs-comment">-- | Convert from POSIX time to Windows time.  This is lossy as Windows time</span><span>
</span><span id="line-573"></span><span class="hs-comment">--   has a resolution of only 100ns.</span><span>
</span><span id="line-574"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#posixToWindowsTime"><span class="hs-identifier hs-type">posixToWindowsTime</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Time.html#FILETIME"><span class="hs-identifier hs-type">Win32.FILETIME</span></a></span><span>
</span><span id="line-575"></span><span id="posixToWindowsTime"><span class="annot"><span class="annottext">posixToWindowsTime :: POSIXTime -&gt; FILETIME
</span><a href="System.Directory.Internal.Windows.html#posixToWindowsTime"><span class="hs-identifier hs-var hs-var">posixToWindowsTime</span></a></span></span><span> </span><span id="local-6989586621679047924"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679047924"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DDWORD -&gt; FILETIME
</span><a href="../../Win32/src/System.Win32.Time.html#FILETIME"><span class="hs-identifier hs-var">Win32.FILETIME</span></a></span><span> </span><span class="annot"><span class="annottext">(DDWORD -&gt; FILETIME) -&gt; DDWORD -&gt; FILETIME
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-576"></span><span>  </span><span class="annot"><span class="annottext">POSIXTime -&gt; DDWORD
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#truncate"><span class="hs-identifier hs-var">truncate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679047924"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime -&gt; POSIXTime -&gt; POSIXTime
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><span class="hs-number">10000000</span></span><span> </span><span class="annot"><span class="annottext">POSIXTime -&gt; POSIXTime -&gt; POSIXTime
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
forall a. Num a =&gt; a
</span><a href="System.Directory.Internal.Windows.html#windowsPosixEpochDifference"><span class="hs-identifier hs-var">windowsPosixEpochDifference</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>
</span><span id="line-578"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setTimes"><span class="hs-identifier hs-type">setTimes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span id="setTimes"><span class="annot"><span class="annottext">setTimes :: String -&gt; (Maybe POSIXTime, Maybe POSIXTime) -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setTimes"><span class="hs-identifier hs-var hs-var">setTimes</span></a></span></span><span> </span><span id="local-6989586621679047920"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047920"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047919"><span class="annot"><span class="annottext">Maybe POSIXTime
</span><a href="#local-6989586621679047919"><span class="hs-identifier hs-var">atime'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679047918"><span class="annot"><span class="annottext">Maybe POSIXTime
</span><a href="#local-6989586621679047918"><span class="hs-identifier hs-var">mtime'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-580"></span><span>  </span><span class="annot"><span class="annottext">IO HANDLE -&gt; (HANDLE -&gt; IO ()) -&gt; (HANDLE -&gt; IO ()) -&gt; IO ()
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO HANDLE
</span><a href="System.Directory.Internal.Windows.html#openFileHandle"><span class="hs-identifier hs-var">openFileHandle</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047920"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#gENERIC_WRITE"><span class="hs-identifier hs-var">Win32.gENERIC_WRITE</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>          </span><span class="annot"><span class="annottext">HANDLE -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#closeHandle"><span class="hs-identifier hs-var">Win32.closeHandle</span></a></span><span> </span><span class="annot"><span class="annottext">((HANDLE -&gt; IO ()) -&gt; IO ()) -&gt; (HANDLE -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679047915"><span class="annot"><span class="annottext">HANDLE
</span><a href="#local-6989586621679047915"><span class="hs-identifier hs-var">handle</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-582"></span><span>
</span><span id="line-583"></span><span class="hs-pragma">{-# LINE 583 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-583"></span><span>  </span><span class="hs-identifier">Win32.setFileTime</span><span> </span><span class="hs-identifier">handle</span><span> </span><span class="hs-identifier">Nothing</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">posixToWindowsTime</span><span> </span><span class="hs-operator">&lt;$&gt;</span><span> </span><span class="hs-identifier">atime'</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">posixToWindowsTime</span><span> </span><span class="hs-operator">&lt;$&gt;</span><span> </span><span class="hs-identifier">mtime'</span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>
</span><span id="line-585"></span><span class="hs-pragma">{-# LINE 590 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-590"></span><span>
</span><span id="line-591"></span><span class="hs-comment">-- | Open the handle of an existing file or directory.</span><span>
</span><span id="line-592"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#openFileHandle"><span class="hs-identifier hs-type">openFileHandle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#AccessMode"><span class="hs-identifier hs-type">Win32.AccessMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Types.html#HANDLE"><span class="hs-identifier hs-type">Win32.HANDLE</span></a></span><span>
</span><span id="line-593"></span><span id="openFileHandle"><span class="annot"><span class="annottext">openFileHandle :: String -&gt; SHGetFolderPathFlags -&gt; IO HANDLE
</span><a href="System.Directory.Internal.Windows.html#openFileHandle"><span class="hs-identifier hs-var hs-var">openFileHandle</span></a></span></span><span> </span><span id="local-6989586621679047912"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047912"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679047911"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047911"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-594"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047912"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO HANDLE -&gt; IO HANDLE
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-595"></span><span>    </span><span id="local-6989586621679047910"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047910"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047912"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-596"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe LPSECURITY_ATTRIBUTES
-&gt; SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags
-&gt; Maybe HANDLE
-&gt; IO HANDLE
</span><a href="../../Win32/src/System.Win32.File.html#createFile"><span class="hs-identifier hs-var">Win32.createFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047910"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047911"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#maxShareMode"><span class="hs-identifier hs-var">maxShareMode</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LPSECURITY_ATTRIBUTES
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-597"></span><span>                     </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#oPEN_EXISTING"><span class="hs-identifier hs-var">Win32.oPEN_EXISTING</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047909"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe HANDLE
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-598"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679047909"><span class="annot"><span class="annottext">flags :: SHGetFolderPathFlags
</span><a href="#local-6989586621679047909"><span class="hs-identifier hs-var hs-var">flags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_NORMAL"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_NORMAL</span></a></span><span>
</span><span id="line-599"></span><span>             </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_FLAG_BACKUP_SEMANTICS"><span class="hs-identifier hs-var">Win32.fILE_FLAG_BACKUP_SEMANTICS</span></a></span><span> </span><span class="hs-comment">-- required for directories</span><span>
</span><span id="line-600"></span><span>
</span><span id="line-601"></span><span class="hs-keyword">type</span><span> </span><span id="Mode"><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-var">Mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.File.html#FileAttributeOrFlag"><span class="hs-identifier hs-type">Win32.FileAttributeOrFlag</span></a></span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#modeFromMetadata"><span class="hs-identifier hs-type">modeFromMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Metadata"><span class="hs-identifier hs-type">Metadata</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>
</span><span id="line-604"></span><span id="modeFromMetadata"><span class="annot"><span class="annottext">modeFromMetadata :: Metadata -&gt; SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#modeFromMetadata"><span class="hs-identifier hs-var hs-var">modeFromMetadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#bhfiFileAttributes"><span class="hs-identifier hs-var hs-var">Win32.bhfiFileAttributes</span></a></span><span>
</span><span id="line-605"></span><span>
</span><span id="line-606"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#hasWriteMode"><span class="hs-identifier hs-type">hasWriteMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-607"></span><span id="hasWriteMode"><span class="annot"><span class="annottext">hasWriteMode :: SHGetFolderPathFlags -&gt; Bool
</span><a href="System.Directory.Internal.Windows.html#hasWriteMode"><span class="hs-identifier hs-var hs-var">hasWriteMode</span></a></span></span><span> </span><span id="local-6989586621679047903"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047903"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047903"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_READONLY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_READONLY</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span>
</span><span id="line-608"></span><span>
</span><span id="line-609"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setWriteMode"><span class="hs-identifier hs-type">setWriteMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>
</span><span id="line-610"></span><span id="setWriteMode"><span class="annot"><span class="annottext">setWriteMode :: Bool -&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#setWriteMode"><span class="hs-identifier hs-var hs-var">setWriteMode</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span id="local-6989586621679047900"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047900"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047900"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_READONLY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_READONLY</span></a></span><span>
</span><span id="line-611"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setWriteMode"><span class="hs-identifier hs-var">setWriteMode</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span id="local-6989586621679047899"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047899"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047899"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#complement"><span class="hs-identifier hs-var">complement</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_READONLY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_READONLY</span></a></span><span>
</span><span id="line-612"></span><span>
</span><span id="line-613"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setFileMode"><span class="hs-identifier hs-type">setFileMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span id="setFileMode"><span class="annot"><span class="annottext">setFileMode :: String -&gt; SHGetFolderPathFlags -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setFileMode"><span class="hs-identifier hs-var hs-var">setFileMode</span></a></span></span><span> </span><span id="local-6989586621679047896"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047896"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679047895"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047895"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-615"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-operator hs-var">`ioeSetFileName`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047896"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IOError) -&gt; IO () -&gt; IO ()
forall a. (IOError -&gt; IOError) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-operator hs-var">`modifyIOError`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-616"></span><span>    </span><span id="local-6989586621679047894"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047894"><span class="hs-identifier hs-var">path'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#furnishPath"><span class="hs-identifier hs-var">furnishPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047896"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-617"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO ()
</span><a href="../../Win32/src/System.Win32.File.html#setFileAttributes"><span class="hs-identifier hs-var">Win32.setFileAttributes</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047894"><span class="hs-identifier hs-var">path'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047895"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span class="hs-comment">-- | A restricted form of 'setFileMode' that only sets the permission bits.</span><span>
</span><span id="line-620"></span><span class="hs-comment">-- For Windows, this means only the &quot;read-only&quot; attribute is affected.</span><span>
</span><span id="line-621"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setFilePermissions"><span class="hs-identifier hs-type">setFilePermissions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Windows.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-622"></span><span id="setFilePermissions"><span class="annot"><span class="annottext">setFilePermissions :: String -&gt; SHGetFolderPathFlags -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setFilePermissions"><span class="hs-identifier hs-var hs-var">setFilePermissions</span></a></span></span><span> </span><span id="local-6989586621679047891"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047891"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679047890"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047890"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-623"></span><span>  </span><span id="local-6989586621679047889"><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047889"><span class="hs-identifier hs-var">m'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Metadata -&gt; SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#modeFromMetadata"><span class="hs-identifier hs-var">modeFromMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">(Metadata -&gt; SHGetFolderPathFlags)
-&gt; IO Metadata -&gt; IO SHGetFolderPathFlags
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Metadata
</span><a href="System.Directory.Internal.Windows.html#getFileMetadata"><span class="hs-identifier hs-var">getFileMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047891"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-624"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setFileMode"><span class="hs-identifier hs-var">setFileMode</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047891"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047889"><span class="hs-identifier hs-var">m'</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#complement"><span class="hs-identifier hs-var">complement</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_READONLY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_READONLY</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span>
</span><span id="line-625"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="#local-6989586621679047890"><span class="hs-identifier hs-var">m</span></a></span><span>  </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
-&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><a href="../../Win32/src/System.Win32.File.html#fILE_ATTRIBUTE_READONLY"><span class="hs-identifier hs-var">Win32.fILE_ATTRIBUTE_READONLY</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>
</span><span id="line-627"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getAccessPermissions"><span class="hs-identifier hs-type">getAccessPermissions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#Permissions"><span class="hs-identifier hs-type">Permissions</span></a></span><span>
</span><span id="line-628"></span><span id="getAccessPermissions"><span class="annot"><span class="annottext">getAccessPermissions :: String -&gt; IO Permissions
</span><a href="System.Directory.Internal.Windows.html#getAccessPermissions"><span class="hs-identifier hs-var hs-var">getAccessPermissions</span></a></span></span><span> </span><span id="local-6989586621679047887"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047887"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-629"></span><span>  </span><span id="local-6989586621679047886"><span class="annot"><span class="annottext">Metadata
</span><a href="#local-6989586621679047886"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Metadata
</span><a href="System.Directory.Internal.Windows.html#getFileMetadata"><span class="hs-identifier hs-var">getFileMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047887"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-630"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047885"><span class="annot"><span class="annottext">isDir :: Bool
</span><a href="#local-6989586621679047885"><span class="hs-identifier hs-var hs-var">isDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FileType -&gt; Bool
</span><a href="System.Directory.Internal.Common.html#fileTypeIsDirectory"><span class="hs-identifier hs-var">fileTypeIsDirectory</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Metadata -&gt; FileType
</span><a href="System.Directory.Internal.Windows.html#fileTypeFromMetadata"><span class="hs-identifier hs-var">fileTypeFromMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata
</span><a href="#local-6989586621679047886"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-631"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047883"><span class="annot"><span class="annottext">w :: Bool
</span><a href="#local-6989586621679047883"><span class="hs-identifier hs-var hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags -&gt; Bool
</span><a href="System.Directory.Internal.Windows.html#hasWriteMode"><span class="hs-identifier hs-var">hasWriteMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Metadata -&gt; SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#modeFromMetadata"><span class="hs-identifier hs-var">modeFromMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">Metadata
</span><a href="#local-6989586621679047886"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-632"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679047878"><span class="annot"><span class="annottext">x :: Bool
</span><a href="#local-6989586621679047878"><span class="hs-identifier hs-var hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="../../base/src/GHC.Unicode.html#toLower"><span class="hs-identifier hs-var">toLower</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; String -&gt; String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeExtension"><span class="hs-identifier hs-var">takeExtension</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047887"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-633"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.bat&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.cmd&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.com&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.exe&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-634"></span><span>  </span><span class="annot"><span class="annottext">Permissions -&gt; IO Permissions
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Permissions :: Bool -&gt; Bool -&gt; Bool -&gt; Bool -&gt; Permissions
</span><a href="System.Directory.Internal.Common.html#Permissions"><span class="hs-identifier hs-type">Permissions</span></a></span><span>
</span><span id="line-635"></span><span>       </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">readable :: Bool
</span><a href="System.Directory.Internal.Common.html#readable"><span class="hs-identifier hs-var">readable</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-636"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">writable :: Bool
</span><a href="System.Directory.Internal.Common.html#writable"><span class="hs-identifier hs-var">writable</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047883"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-637"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">executable :: Bool
</span><a href="System.Directory.Internal.Common.html#executable"><span class="hs-identifier hs-var">executable</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047878"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047885"><span class="hs-identifier hs-var">isDir</span></a></span><span>
</span><span id="line-638"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">searchable :: Bool
</span><a href="System.Directory.Internal.Common.html#searchable"><span class="hs-identifier hs-var">searchable</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047885"><span class="hs-identifier hs-var">isDir</span></a></span><span>
</span><span id="line-639"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#setAccessPermissions"><span class="hs-identifier hs-type">setAccessPermissions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#Permissions"><span class="hs-identifier hs-type">Permissions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-642"></span><span id="setAccessPermissions"><span class="annot"><span class="annottext">setAccessPermissions :: String -&gt; Permissions -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setAccessPermissions"><span class="hs-identifier hs-var hs-var">setAccessPermissions</span></a></span></span><span> </span><span id="local-6989586621679047870"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047870"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#Permissions"><span class="hs-identifier hs-type">Permissions</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">writable :: Permissions -&gt; Bool
</span><a href="System.Directory.Internal.Common.html#writable"><span class="hs-identifier hs-var">writable</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621679047869"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047869"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-643"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; SHGetFolderPathFlags -&gt; IO ()
</span><a href="System.Directory.Internal.Windows.html#setFilePermissions"><span class="hs-identifier hs-var">setFilePermissions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047870"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; SHGetFolderPathFlags -&gt; SHGetFolderPathFlags
</span><a href="System.Directory.Internal.Windows.html#setWriteMode"><span class="hs-identifier hs-var">setWriteMode</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679047869"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-644"></span><span>
</span><span id="line-645"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-type">getFolderPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../Win32/src/System.Win32.Shell.html#CSIDL"><span class="hs-identifier hs-type">Win32.CSIDL</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-646"></span><span id="getFolderPath"><span class="annot"><span class="annottext">getFolderPath :: CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var hs-var">getFolderPath</span></a></span></span><span> </span><span id="local-6989586621679047867"><span class="annot"><span class="annottext">CSIDL
</span><a href="#local-6989586621679047867"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HANDLE -&gt; CSIDL -&gt; HANDLE -&gt; SHGetFolderPathFlags -&gt; IO String
</span><a href="../../Win32/src/System.Win32.Shell.html#sHGetFolderPath"><span class="hs-identifier hs-var">Win32.sHGetFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
forall {b}. Ptr b
</span><a href="../../base/src/GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="#local-6989586621679047867"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">HANDLE
forall {b}. Ptr b
</span><a href="../../base/src/GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span> </span><span class="annot"><span class="annottext">SHGetFolderPathFlags
</span><span class="hs-number">0</span></span><span>
</span><span id="line-647"></span><span>
</span><span id="line-648"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getHomeDirectoryInternal"><span class="hs-identifier hs-type">getHomeDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-649"></span><span id="getHomeDirectoryInternal"><span class="annot"><span class="annottext">getHomeDirectoryInternal :: IO String
</span><a href="System.Directory.Internal.Windows.html#getHomeDirectoryInternal"><span class="hs-identifier hs-var hs-var">getHomeDirectoryInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-650"></span><span>  </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="../../Win32/src/System.Win32.Shell.html#cSIDL_PROFILE"><span class="hs-identifier hs-var">Win32.cSIDL_PROFILE</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; (IOError -&gt; IO String) -&gt; IO String
forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#catchIOError"><span class="hs-operator hs-var">`catchIOError`</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">IOError
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-651"></span><span>    </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="../../Win32/src/System.Win32.Shell.html#cSIDL_WINDOWS"><span class="hs-identifier hs-var">Win32.cSIDL_WINDOWS</span></a></span><span>
</span><span id="line-652"></span><span>
</span><span id="line-653"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getXdgDirectoryFallback"><span class="hs-identifier hs-type">getXdgDirectoryFallback</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#XdgDirectory"><span class="hs-identifier hs-type">XdgDirectory</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-654"></span><span id="getXdgDirectoryFallback"><span class="annot"><span class="annottext">getXdgDirectoryFallback :: IO String -&gt; XdgDirectory -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getXdgDirectoryFallback"><span class="hs-identifier hs-var hs-var">getXdgDirectoryFallback</span></a></span></span><span> </span><span class="annot"><span class="annottext">IO String
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679047861"><span class="annot"><span class="annottext">XdgDirectory
</span><a href="#local-6989586621679047861"><span class="hs-identifier hs-var">xdgDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-655"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">XdgDirectory
</span><a href="#local-6989586621679047861"><span class="hs-identifier hs-var">xdgDir</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-656"></span><span>    </span><span class="annot"><span class="annottext">XdgDirectory
</span><a href="System.Directory.Internal.Common.html#XdgData"><span class="hs-identifier hs-var">XdgData</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="../../Win32/src/System.Win32.Shell.html#cSIDL_APPDATA"><span class="hs-identifier hs-var">Win32.cSIDL_APPDATA</span></a></span><span>
</span><span id="line-657"></span><span>    </span><span class="annot"><span class="annottext">XdgDirectory
</span><a href="System.Directory.Internal.Common.html#XdgConfig"><span class="hs-identifier hs-var">XdgConfig</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="../../Win32/src/System.Win32.Shell.html#cSIDL_APPDATA"><span class="hs-identifier hs-var">Win32.cSIDL_APPDATA</span></a></span><span>
</span><span id="line-658"></span><span>    </span><span class="annot"><span class="annottext">XdgDirectory
</span><a href="System.Directory.Internal.Common.html#XdgCache"><span class="hs-identifier hs-var">XdgCache</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="System.Directory.Internal.Windows.html#win32_cSIDL_LOCAL_APPDATA"><span class="hs-identifier hs-var">win32_cSIDL_LOCAL_APPDATA</span></a></span><span>
</span><span id="line-659"></span><span>
</span><span id="line-660"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getXdgDirectoryListFallback"><span class="hs-identifier hs-type">getXdgDirectoryListFallback</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Directory.Internal.Common.html#XdgDirectoryList"><span class="hs-identifier hs-type">XdgDirectoryList</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-661"></span><span id="getXdgDirectoryListFallback"><span class="annot"><span class="annottext">getXdgDirectoryListFallback :: XdgDirectoryList -&gt; IO [String]
</span><a href="System.Directory.Internal.Windows.html#getXdgDirectoryListFallback"><span class="hs-identifier hs-var hs-var">getXdgDirectoryListFallback</span></a></span></span><span> </span><span class="annot"><span class="annottext">XdgDirectoryList
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-662"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; [String]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; [String]) -&gt; IO String -&gt; IO [String]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="System.Directory.Internal.Windows.html#win32_cSIDL_COMMON_APPDATA"><span class="hs-identifier hs-var">win32_cSIDL_COMMON_APPDATA</span></a></span><span>
</span><span id="line-663"></span><span>
</span><span id="line-664"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getAppUserDataDirectoryInternal"><span class="hs-identifier hs-type">getAppUserDataDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-665"></span><span id="getAppUserDataDirectoryInternal"><span class="annot"><span class="annottext">getAppUserDataDirectoryInternal :: String -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getAppUserDataDirectoryInternal"><span class="hs-identifier hs-var hs-var">getAppUserDataDirectoryInternal</span></a></span></span><span> </span><span id="local-6989586621679047854"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047854"><span class="hs-identifier hs-var">appName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-666"></span><span>  </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679047853"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047853"><span class="hs-identifier hs-var">appData</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047853"><span class="hs-identifier hs-var">appData</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047854"><span class="hs-identifier hs-var">appName</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-667"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; IO String -&gt; IO String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; XdgDirectory -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getXdgDirectoryFallback"><span class="hs-identifier hs-var">getXdgDirectoryFallback</span></a></span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="System.Directory.Internal.Windows.html#getHomeDirectoryInternal"><span class="hs-identifier hs-var">getHomeDirectoryInternal</span></a></span><span> </span><span class="annot"><span class="annottext">XdgDirectory
</span><a href="System.Directory.Internal.Common.html#XdgData"><span class="hs-identifier hs-var">XdgData</span></a></span><span>
</span><span id="line-668"></span><span>
</span><span id="line-669"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getUserDocumentsDirectoryInternal"><span class="hs-identifier hs-type">getUserDocumentsDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-670"></span><span id="getUserDocumentsDirectoryInternal"><span class="annot"><span class="annottext">getUserDocumentsDirectoryInternal :: IO String
</span><a href="System.Directory.Internal.Windows.html#getUserDocumentsDirectoryInternal"><span class="hs-identifier hs-var hs-var">getUserDocumentsDirectoryInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CSIDL -&gt; IO String
</span><a href="System.Directory.Internal.Windows.html#getFolderPath"><span class="hs-identifier hs-var">getFolderPath</span></a></span><span> </span><span class="annot"><span class="annottext">CSIDL
</span><a href="../../Win32/src/System.Win32.Shell.html#cSIDL_PERSONAL"><span class="hs-identifier hs-var">Win32.cSIDL_PERSONAL</span></a></span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span class="annot"><a href="System.Directory.Internal.Windows.html#getTemporaryDirectoryInternal"><span class="hs-identifier hs-type">getTemporaryDirectoryInternal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-673"></span><span id="getTemporaryDirectoryInternal"><span class="annot"><span class="annottext">getTemporaryDirectoryInternal :: IO String
</span><a href="System.Directory.Internal.Windows.html#getTemporaryDirectoryInternal"><span class="hs-identifier hs-var hs-var">getTemporaryDirectoryInternal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../Win32/src/System.Win32.Info.html#getTemporaryDirectory"><span class="hs-identifier hs-var">Win32.getTemporaryDirectory</span></a></span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span>
</span><span id="line-676"></span><span class="hs-pragma">{-# LINE 676 &quot;libraries\\directory\\System\\Directory\\Internal\\Windows.hsc&quot; #-}</span><span>
</span><span id="line-676"></span></pre></body></html>